Skip to content

[SYCL] Fix unused variable warnings and unittests #8875

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
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
12 changes: 12 additions & 0 deletions sycl/include/sycl/ext/intel/experimental/pipes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ class pipe : public pipe_base {
// Host API
static _dataT read(queue &Q, bool &Success,
memory_order Order = memory_order::seq_cst) {
// Order is currently unused.
std::ignore = Order;

const device Dev = Q.get_device();
bool IsPipeSupported =
Dev.has_extension("cl_intel_program_scope_host_pipe");
Expand Down Expand Up @@ -95,6 +98,9 @@ class pipe : public pipe_base {

static void write(queue &Q, const _dataT &Data, bool &Success,
memory_order Order = memory_order::seq_cst) {
// Order is currently unused.
std::ignore = Order;

const device Dev = Q.get_device();
bool IsPipeSupported =
Dev.has_extension("cl_intel_program_scope_host_pipe");
Expand Down Expand Up @@ -221,6 +227,9 @@ class pipe : public pipe_base {

// Host API
static _dataT read(queue &Q, memory_order Order = memory_order::seq_cst) {
// Order is currently unused.
std::ignore = Order;

const device Dev = Q.get_device();
bool IsPipeSupported =
Dev.has_extension("cl_intel_program_scope_host_pipe");
Expand All @@ -241,6 +250,9 @@ class pipe : public pipe_base {

static void write(queue &Q, const _dataT &Data,
memory_order Order = memory_order::seq_cst) {
// Order is currently unused.
std::ignore = Order;

const device Dev = Q.get_device();
bool IsPipeSupported =
Dev.has_extension("cl_intel_program_scope_host_pipe");
Expand Down
5 changes: 3 additions & 2 deletions sycl/unittests/pipes/host_pipe_registration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ pi_result after_piDeviceGetInfo(pi_device device, pi_device_info param_name,
switch (param_name) {
case PI_DEVICE_INFO_EXTENSIONS: {
if (param_value) {
std::ignore = param_value_size;
assert(param_value_size >= sizeof(MockSupportedExtensions));
std::memcpy(param_value, MockSupportedExtensions,
sizeof(MockSupportedExtensions));
Expand Down Expand Up @@ -153,10 +154,10 @@ TEST_F(PipeTest, Basic) {
// Testing read
int HostPipeReadData;
HostPipeReadData = Pipe::read(q);
assert(HostPipeReadData == PipeReadVal);
EXPECT_EQ(HostPipeReadData, PipeReadVal);

// Testing write
int HostPipeWriteData = 9;
Pipe::write(q, HostPipeWriteData);
assert(PipeWriteVal == 9);
EXPECT_EQ(PipeWriteVal, 9);
}