Skip to content

[SYCL][CUDA] Fix selected_binary argument in piextDeviceSelectBinary #1475

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

Merged
merged 1 commit into from
Apr 7, 2020
Merged
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
7 changes: 2 additions & 5 deletions sycl/plugins/cuda/pi_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -791,23 +791,20 @@ pi_result cuda_piDevicePartition(
pi_result cuda_piextDeviceSelectBinary(pi_device device,
pi_device_binary *binaries,
pi_uint32 num_binaries,
pi_device_binary *selected_binary) {
pi_uint32 *selected_binary) {
if (!binaries) {
cl::sycl::detail::pi::die("No list of device images provided");
}
if (num_binaries < 1) {
cl::sycl::detail::pi::die("No binary images in the list");
}
if (!selected_binary) {
cl::sycl::detail::pi::die("No storage for device binary provided");
}

// Look for an image for the NVPTX64 target, and return the first one that is
// found
for (pi_uint32 i = 0; i < num_binaries; i++) {
if (strcmp(binaries[i]->DeviceTargetSpec,
PI_DEVICE_BINARY_TARGET_NVPTX64) == 0) {
*selected_binary = binaries[i];
*selected_binary = i;
return PI_SUCCESS;
}
}
Expand Down