Skip to content

Commit

Permalink
Add more CTS coverage for urKernelSetArgSampler
Browse files Browse the repository at this point in the history
  • Loading branch information
omarahmed1111 committed Apr 4, 2024
1 parent 03b7148 commit 33514ae
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 45 deletions.
22 changes: 21 additions & 1 deletion test/conformance/kernel/kernel_adapter_native_cpu.match
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,27 @@ urKernelSetArgPointerTest.SuccessDevice/SYCL_NATIVE_CPU___SYCL_Native_CPU_
urKernelSetArgPointerTest.SuccessShared/SYCL_NATIVE_CPU___SYCL_Native_CPU_
urKernelSetArgPointerNegativeTest.InvalidNullHandleKernel/SYCL_NATIVE_CPU___SYCL_Native_CPU_
urKernelSetArgPointerNegativeTest.InvalidKernelArgumentIndex/SYCL_NATIVE_CPU___SYCL_Native_CPU_
urKernelSetArgSamplerTest.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU_
urKernelSetArgSamplerTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_NONE_UR_SAMPLER_FILTER_MODE_NEAREST
urKernelSetArgSamplerTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_NONE_UR_SAMPLER_FILTER_MODE_LINEAR
urKernelSetArgSamplerTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE_UR_SAMPLER_FILTER_MODE_NEAREST
urKernelSetArgSamplerTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE_UR_SAMPLER_FILTER_MODE_LINEAR
urKernelSetArgSamplerTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_UR_SAMPLER_FILTER_MODE_NEAREST
urKernelSetArgSamplerTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_UR_SAMPLER_FILTER_MODE_LINEAR
urKernelSetArgSamplerTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_REPEAT_UR_SAMPLER_FILTER_MODE_NEAREST
urKernelSetArgSamplerTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_REPEAT_UR_SAMPLER_FILTER_MODE_LINEAR
urKernelSetArgSamplerTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT_UR_SAMPLER_FILTER_MODE_NEAREST
urKernelSetArgSamplerTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT_UR_SAMPLER_FILTER_MODE_LINEAR
urKernelSetArgSamplerTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_NONE_UR_SAMPLER_FILTER_MODE_NEAREST
urKernelSetArgSamplerTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_NONE_UR_SAMPLER_FILTER_MODE_LINEAR
urKernelSetArgSamplerTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE_UR_SAMPLER_FILTER_MODE_NEAREST
urKernelSetArgSamplerTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE_UR_SAMPLER_FILTER_MODE_LINEAR
urKernelSetArgSamplerTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_UR_SAMPLER_FILTER_MODE_NEAREST
urKernelSetArgSamplerTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_UR_SAMPLER_FILTER_MODE_LINEAR
urKernelSetArgSamplerTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_REPEAT_UR_SAMPLER_FILTER_MODE_NEAREST
urKernelSetArgSamplerTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_REPEAT_UR_SAMPLER_FILTER_MODE_LINEAR
urKernelSetArgSamplerTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT_UR_SAMPLER_FILTER_MODE_NEAREST
urKernelSetArgSamplerTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT_UR_SAMPLER_FILTER_MODE_LINEAR
urKernelSetArgSamplerTest.SuccessWithProps/SYCL_NATIVE_CPU___SYCL_Native_CPU_
urKernelSetArgSamplerTest.InvalidNullHandleKernel/SYCL_NATIVE_CPU___SYCL_Native_CPU_
urKernelSetArgSamplerTest.InvalidNullHandleArgValue/SYCL_NATIVE_CPU___SYCL_Native_CPU_
urKernelSetArgSamplerTest.InvalidKernelArgumentIndex/SYCL_NATIVE_CPU___SYCL_Native_CPU_
Expand Down
67 changes: 65 additions & 2 deletions test/conformance/kernel/urKernelSetArgSampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,66 @@

#include <uur/fixtures.h>

struct urKernelSetArgSamplerTestWithParam
: uur::urBaseKernelTestWithParam<uur::SamplerCreateParamT> {
void SetUp() {
program_name = "image_copy";
UUR_RETURN_ON_FATAL_FAILURE(
uur::urBaseKernelTestWithParam<uur::SamplerCreateParamT>::SetUp());
// Images and samplers are not available on AMD
ur_platform_backend_t backend;
ASSERT_SUCCESS(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND,
sizeof(backend), &backend, nullptr));
if (backend == UR_PLATFORM_BACKEND_HIP) {
GTEST_SKIP() << "Sampler are not supported on hip.";
}
UUR_RETURN_ON_FATAL_FAILURE(
uur::urBaseKernelTestWithParam<uur::SamplerCreateParamT>::Build());

const auto param = getParam();
const auto normalized = std::get<0>(param);
const auto addr_mode = std::get<1>(param);
const auto filter_mode = std::get<2>(param);

ur_sampler_desc_t sampler_desc = {
UR_STRUCTURE_TYPE_SAMPLER_DESC, /* sType */
nullptr, /* pNext */
normalized, /* normalizedCoords */
addr_mode, /* addressingMode */
filter_mode /* filterMode */
};
ASSERT_SUCCESS(urSamplerCreate(context, &sampler_desc, &sampler));
}

void TearDown() {
if (sampler) {
ASSERT_SUCCESS(urSamplerRelease(sampler));
}
UUR_RETURN_ON_FATAL_FAILURE(uur::urBaseKernelTestWithParam<
uur::SamplerCreateParamT>::TearDown());
}

ur_sampler_handle_t sampler = nullptr;
};

UUR_TEST_SUITE_P(
urKernelSetArgSamplerTestWithParam,
::testing::Combine(
::testing::Values(true, false),
::testing::Values(UR_SAMPLER_ADDRESSING_MODE_NONE,
UR_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE,
UR_SAMPLER_ADDRESSING_MODE_CLAMP,
UR_SAMPLER_ADDRESSING_MODE_REPEAT,
UR_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT),
::testing::Values(UR_SAMPLER_FILTER_MODE_NEAREST,
UR_SAMPLER_FILTER_MODE_LINEAR)),
uur::deviceTestWithParamPrinter<uur::SamplerCreateParamT>);

TEST_P(urKernelSetArgSamplerTestWithParam, Success) {
uint32_t arg_index = 2;
ASSERT_SUCCESS(urKernelSetArgSampler(kernel, arg_index, nullptr, sampler));
}

struct urKernelSetArgSamplerTest : uur::urBaseKernelTest {
void SetUp() {
program_name = "image_copy";
Expand Down Expand Up @@ -36,10 +96,13 @@ struct urKernelSetArgSamplerTest : uur::urBaseKernelTest {

ur_sampler_handle_t sampler = nullptr;
};

UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelSetArgSamplerTest);

TEST_P(urKernelSetArgSamplerTest, Success) {
ASSERT_SUCCESS(urKernelSetArgSampler(kernel, 2, nullptr, sampler));
TEST_P(urKernelSetArgSamplerTest, SuccessWithProps) {
ur_kernel_arg_sampler_properties_t props{
UR_STRUCTURE_TYPE_KERNEL_ARG_SAMPLER_PROPERTIES, nullptr};
ASSERT_SUCCESS(urKernelSetArgSampler(kernel, 2, &props, sampler));
}

TEST_P(urKernelSetArgSamplerTest, InvalidNullHandleKernel) {
Expand Down
40 changes: 20 additions & 20 deletions test/conformance/sampler/sampler_adapter_native_cpu.match
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___1_UR_SAMPLER_ADDRESSING_MODE_NONE_UR_SAMPLER_FILTER_MODE_NEAREST
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___1_UR_SAMPLER_ADDRESSING_MODE_NONE_UR_SAMPLER_FILTER_MODE_LINEAR
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___1_UR_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE_UR_SAMPLER_FILTER_MODE_NEAREST
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___1_UR_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE_UR_SAMPLER_FILTER_MODE_LINEAR
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___1_UR_SAMPLER_ADDRESSING_MODE_CLAMP_UR_SAMPLER_FILTER_MODE_NEAREST
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___1_UR_SAMPLER_ADDRESSING_MODE_CLAMP_UR_SAMPLER_FILTER_MODE_LINEAR
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___1_UR_SAMPLER_ADDRESSING_MODE_REPEAT_UR_SAMPLER_FILTER_MODE_NEAREST
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___1_UR_SAMPLER_ADDRESSING_MODE_REPEAT_UR_SAMPLER_FILTER_MODE_LINEAR
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___1_UR_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT_UR_SAMPLER_FILTER_MODE_NEAREST
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___1_UR_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT_UR_SAMPLER_FILTER_MODE_LINEAR
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___0_UR_SAMPLER_ADDRESSING_MODE_NONE_UR_SAMPLER_FILTER_MODE_NEAREST
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___0_UR_SAMPLER_ADDRESSING_MODE_NONE_UR_SAMPLER_FILTER_MODE_LINEAR
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___0_UR_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE_UR_SAMPLER_FILTER_MODE_NEAREST
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___0_UR_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE_UR_SAMPLER_FILTER_MODE_LINEAR
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___0_UR_SAMPLER_ADDRESSING_MODE_CLAMP_UR_SAMPLER_FILTER_MODE_NEAREST
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___0_UR_SAMPLER_ADDRESSING_MODE_CLAMP_UR_SAMPLER_FILTER_MODE_LINEAR
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___0_UR_SAMPLER_ADDRESSING_MODE_REPEAT_UR_SAMPLER_FILTER_MODE_NEAREST
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___0_UR_SAMPLER_ADDRESSING_MODE_REPEAT_UR_SAMPLER_FILTER_MODE_LINEAR
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___0_UR_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT_UR_SAMPLER_FILTER_MODE_NEAREST
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___0_UR_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT_UR_SAMPLER_FILTER_MODE_LINEAR
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_NONE_UR_SAMPLER_FILTER_MODE_NEAREST
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_NONE_UR_SAMPLER_FILTER_MODE_LINEAR
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE_UR_SAMPLER_FILTER_MODE_NEAREST
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE_UR_SAMPLER_FILTER_MODE_LINEAR
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_UR_SAMPLER_FILTER_MODE_NEAREST
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_UR_SAMPLER_FILTER_MODE_LINEAR
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_REPEAT_UR_SAMPLER_FILTER_MODE_NEAREST
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_REPEAT_UR_SAMPLER_FILTER_MODE_LINEAR
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT_UR_SAMPLER_FILTER_MODE_NEAREST
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___NORMALIZED_UR_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT_UR_SAMPLER_FILTER_MODE_LINEAR
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_NONE_UR_SAMPLER_FILTER_MODE_NEAREST
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_NONE_UR_SAMPLER_FILTER_MODE_LINEAR
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE_UR_SAMPLER_FILTER_MODE_NEAREST
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE_UR_SAMPLER_FILTER_MODE_LINEAR
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_UR_SAMPLER_FILTER_MODE_NEAREST
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_CLAMP_UR_SAMPLER_FILTER_MODE_LINEAR
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_REPEAT_UR_SAMPLER_FILTER_MODE_NEAREST
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_REPEAT_UR_SAMPLER_FILTER_MODE_LINEAR
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT_UR_SAMPLER_FILTER_MODE_NEAREST
urSamplerCreateTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UNNORMALIZED_UR_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT_UR_SAMPLER_FILTER_MODE_LINEAR
urSamplerCreateWithNativeHandleTest.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU_
urSamplerGetInfoTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UR_SAMPLER_INFO_REFERENCE_COUNT
urSamplerGetInfoTestWithParam.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU___UR_SAMPLER_INFO_CONTEXT
Expand Down
24 changes: 2 additions & 22 deletions test/conformance/sampler/urSamplerCreate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,9 @@
#include "uur/fixtures.h"
#include "uur/raii.h"

using SamplerCreateParamTy =
std::tuple<bool, ur_sampler_addressing_mode_t, ur_sampler_filter_mode_t>;

struct urSamplerCreateTestWithParam
: uur::urContextTestWithParam<SamplerCreateParamTy> {};

namespace uur {
template <>
std::string deviceTestWithParamPrinter(
const ::testing::TestParamInfo<
std::tuple<ur_device_handle_t, SamplerCreateParamTy>> &info) {
auto device = std::get<0>(info.param);
auto param = std::get<1>(info.param);
: uur::urContextTestWithParam<uur::SamplerCreateParamT> {};

const auto normalized = std::get<0>(param);
const auto addr_mode = std::get<1>(param);
const auto filter_mode = std::get<2>(param);

std::stringstream ss;
ss << normalized << "_" << addr_mode << "_" << filter_mode;
return uur::GetPlatformAndDeviceName(device) + "__" + ss.str();
}
} // namespace uur
UUR_TEST_SUITE_P(
urSamplerCreateTestWithParam,
::testing::Combine(
Expand All @@ -40,7 +20,7 @@ UUR_TEST_SUITE_P(
UR_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT),
::testing::Values(UR_SAMPLER_FILTER_MODE_NEAREST,
UR_SAMPLER_FILTER_MODE_LINEAR)),
uur::deviceTestWithParamPrinter<SamplerCreateParamTy>);
uur::deviceTestWithParamPrinter<uur::SamplerCreateParamT>);

TEST_P(urSamplerCreateTestWithParam, Success) {

Expand Down
8 changes: 8 additions & 0 deletions test/conformance/testing/include/uur/fixtures.h
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,14 @@ std::string deviceTestWithParamPrinter<BoolTestParam>(
const ::testing::TestParamInfo<
std::tuple<ur_device_handle_t, BoolTestParam>> &info);

using SamplerCreateParamT =
std::tuple<bool, ur_sampler_addressing_mode_t, ur_sampler_filter_mode_t>;

template <>
std::string deviceTestWithParamPrinter<SamplerCreateParamT>(
const ::testing::TestParamInfo<
std::tuple<ur_device_handle_t, SamplerCreateParamT>> &info);

struct urProgramTest : urQueueTest {
void SetUp() override {
UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::SetUp());
Expand Down
22 changes: 22 additions & 0 deletions test/conformance/testing/source/fixtures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,26 @@ std::string deviceTestWithParamPrinter<BoolTestParam>(
ss << param.name << (param.value ? "Enabled" : "Disabled");
return uur::GetPlatformAndDeviceName(device) + "__" + ss.str();
}

template <>
std::string deviceTestWithParamPrinter<SamplerCreateParamT>(
const ::testing::TestParamInfo<
std::tuple<ur_device_handle_t, uur::SamplerCreateParamT>> &info) {
auto device = std::get<0>(info.param);
auto param = std::get<1>(info.param);

const auto normalized = std::get<0>(param);
const auto addr_mode = std::get<1>(param);
const auto filter_mode = std::get<2>(param);

std::stringstream ss;

if (normalized) {
ss << "NORMALIZED_";
} else {
ss << "UNNORMALIZED_";
}
ss << addr_mode << "_" << filter_mode;
return uur::GetPlatformAndDeviceName(device) + "__" + ss.str();
}
} // namespace uur

0 comments on commit 33514ae

Please sign in to comment.