Skip to content

Commit

Permalink
[SYCL] Follow-up for #7599 - return PI_ERROR_INVALID_VALUE after asse…
Browse files Browse the repository at this point in the history
…rt (#7764)
  • Loading branch information
aelovikov-intel committed Dec 13, 2022
1 parent 4ab9bf2 commit 7179e83
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sycl/plugins/cuda/pi_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2534,9 +2534,13 @@ pi_result cuda_piextQueueCreate(pi_context Context, pi_device Device,
assert(Properties);
// Expect flags mask to be passed first.
assert(Properties[0] == PI_QUEUE_FLAGS);
if (Properties[0] != PI_QUEUE_FLAGS)
return PI_ERROR_INVALID_VALUE;
pi_queue_properties Flags = Properties[1];
// Extra data isn't supported yet.
assert(Properties[2] == 0);
if (Properties[2] != 0)
return PI_ERROR_INVALID_VALUE;
return cuda_piQueueCreate(Context, Device, Flags, Queue);
}

Expand Down
4 changes: 4 additions & 0 deletions sycl/plugins/esimd_emulator/pi_esimd_emulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -930,9 +930,13 @@ pi_result piextQueueCreate(pi_context Context, pi_device Device,
assert(Properties);
// Expect flags mask to be passed first.
assert(Properties[0] == PI_QUEUE_FLAGS);
if (Properties[0] != PI_QUEUE_FLAGS)
return PI_ERROR_INVALID_VALUE;
pi_queue_properties Flags = Properties[1];
// Extra data isn't supported yet.
assert(Properties[2] == 0);
if (Properties[2] != 0)
return PI_ERROR_INVALID_VALUE;
return piQueueCreate(Context, Device, Flags, Queue);
}
pi_result piQueueCreate(pi_context Context, pi_device Device,
Expand Down
4 changes: 4 additions & 0 deletions sycl/plugins/hip/pi_hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2411,9 +2411,13 @@ pi_result hip_piextQueueCreate(pi_context Context, pi_device Device,
assert(Properties);
// Expect flags mask to be passed first.
assert(Properties[0] == PI_QUEUE_FLAGS);
if (Properties[0] != PI_QUEUE_FLAGS)
return PI_ERROR_INVALID_VALUE;
pi_queue_properties Flags = Properties[1];
// Extra data isn't supported yet.
assert(Properties[2] == 0);
if (Properties[2] != 0)
return PI_ERROR_INVALID_VALUE;
return hip_piQueueCreate(Context, Device, Flags, Queue);
}

Expand Down
4 changes: 4 additions & 0 deletions sycl/plugins/opencl/pi_opencl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,13 @@ pi_result piextQueueCreate(pi_context Context, pi_device Device,
assert(Properties);
// Expect flags mask to be passed first.
assert(Properties[0] == PI_QUEUE_FLAGS);
if (Properties[0] != PI_QUEUE_FLAGS)
return PI_ERROR_INVALID_VALUE;
pi_queue_properties Flags = Properties[1];
// Extra data isn't supported yet.
assert(Properties[2] == 0);
if (Properties[2] != 0)
return PI_ERROR_INVALID_VALUE;
return piQueueCreate(Context, Device, Flags, Queue);
}
pi_result piQueueCreate(pi_context context, pi_device device,
Expand Down

0 comments on commit 7179e83

Please sign in to comment.