Skip to content

[UR][CTS] Spec wording around PROGRAM_INFO_BINARIES and test #19321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: sycl
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions unified-runtime/include/ur_api.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion unified-runtime/include/ur_print.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion unified-runtime/scripts/core/program.yml
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ etors:
- name: BINARY_SIZES
desc: "[size_t[]] Return program binary sizes for each device."
- name: BINARIES
desc: "[unsigned char[]] Return program binaries for all devices for this Program. These are not null-terminated."
desc: "[unsigned char *[]] Write program binaries into caller-provided buffers for each device. These are not null-terminated."
- name: NUM_KERNELS
desc: "[size_t][optional-query] Number of kernels in Program, return type size_t."
- name: KERNEL_NAMES
Expand Down
2 changes: 1 addition & 1 deletion unified-runtime/scripts/templates/print.hpp.mako
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const ur_bool
%>case ${ename}: {
%if th.value_traits.is_array(vtype):
<% atype = th.value_traits.get_array_name(vtype) %>
%if 'void' in atype:
%if 'void' in atype or '*' in atype:
const ${atype} const *tptr = (const ${atype} const*)ptr;
%else:
const ${atype} *tptr = (const ${atype} *)ptr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ TEST_P(urProgramGetInfoTest, SuccessBinarySizes) {
}

TEST_P(urProgramGetInfoTest, SuccessBinaries) {
// Not implemented correctly on these targets - they copy their own pointer into the output rather than copying the
// binary
UUR_KNOWN_FAILURE_ON(uur::HIP{}, uur::CUDA{});

size_t binary_sizes_len = 0;
std::vector<char> property_value(0);

Expand All @@ -175,6 +179,11 @@ TEST_P(urProgramGetInfoTest, SuccessBinaries) {
urProgramGetInfo(program, UR_PROGRAM_INFO_BINARIES, sizeof(binaries[0]),
binaries, nullptr),
UR_PROGRAM_INFO_BINARIES);

// We assume that there is at least 1 non-zero byte in the binary
bool nonzero_found = std::any_of(property_value.begin(), property_value.end(),
[](char c) { return c != 0; });
ASSERT_TRUE(nonzero_found);
}

TEST_P(urProgramGetInfoTest, SuccessNumKernels) {
Expand Down