Skip to content

Commit

Permalink
Merge pull request oneapi-src#1295 from kbenzie/benie/fix-test-adapte…
Browse files Browse the repository at this point in the history
…r-cuda-sizeof

[CUDA] Fix sizeof(const char*) usage
  • Loading branch information
kbenzie authored Feb 1, 2024
2 parents 9363574 + 58e22d3 commit 3696d46
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions test/adapters/cuda/kernel_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ const char *threeParamsTwoLocal = "\n\
TEST_P(cudaKernelTest, CreateProgramAndKernel) {

uur::raii::Program program = nullptr;
ASSERT_SUCCESS(urProgramCreateWithBinary(context, device, sizeof(ptxSource),
(const uint8_t *)ptxSource,
nullptr, program.ptr()));
ASSERT_SUCCESS(urProgramCreateWithBinary(
context, device, std::strlen(ptxSource), (const uint8_t *)ptxSource,
nullptr, program.ptr()));
ASSERT_NE(program, nullptr);
ASSERT_SUCCESS(urProgramBuild(context, program, nullptr));

Expand Down Expand Up @@ -116,9 +116,9 @@ TEST_P(cudaKernelTest, CreateProgramAndKernelWithMetadata) {
ur_program_properties_t programProps{UR_STRUCTURE_TYPE_PROGRAM_PROPERTIES,
nullptr, 1, &reqdWorkGroupSizeMDProp};
uur::raii::Program program = nullptr;
ASSERT_SUCCESS(urProgramCreateWithBinary(context, device, sizeof(ptxSource),
(const uint8_t *)ptxSource,
&programProps, program.ptr()));
ASSERT_SUCCESS(urProgramCreateWithBinary(
context, device, std::strlen(ptxSource), (const uint8_t *)ptxSource,
&programProps, program.ptr()));
ASSERT_NE(program, nullptr);

ASSERT_SUCCESS(urProgramBuild(context, program, nullptr));
Expand All @@ -138,9 +138,9 @@ TEST_P(cudaKernelTest, CreateProgramAndKernelWithMetadata) {

TEST_P(cudaKernelTest, URKernelArgumentSimple) {
uur::raii::Program program = nullptr;
ASSERT_SUCCESS(urProgramCreateWithBinary(context, device, sizeof(ptxSource),
(const uint8_t *)ptxSource,
nullptr, program.ptr()));
ASSERT_SUCCESS(urProgramCreateWithBinary(
context, device, std::strlen(ptxSource), (const uint8_t *)ptxSource,
nullptr, program.ptr()));
ASSERT_NE(program, nullptr);
ASSERT_SUCCESS(urProgramBuild(context, program, nullptr));

Expand All @@ -160,9 +160,9 @@ TEST_P(cudaKernelTest, URKernelArgumentSimple) {

TEST_P(cudaKernelTest, URKernelArgumentSetTwice) {
uur::raii::Program program = nullptr;
ASSERT_SUCCESS(urProgramCreateWithBinary(context, device, sizeof(ptxSource),
(const uint8_t *)ptxSource,
nullptr, program.ptr()));
ASSERT_SUCCESS(urProgramCreateWithBinary(
context, device, std::strlen(ptxSource), (const uint8_t *)ptxSource,
nullptr, program.ptr()));
ASSERT_NE(program, nullptr);
ASSERT_SUCCESS(urProgramBuild(context, program, nullptr));

Expand All @@ -189,9 +189,9 @@ TEST_P(cudaKernelTest, URKernelArgumentSetTwice) {

TEST_P(cudaKernelTest, URKernelDispatch) {
uur::raii::Program program = nullptr;
ASSERT_SUCCESS(urProgramCreateWithBinary(context, device, sizeof(ptxSource),
(const uint8_t *)ptxSource,
nullptr, program.ptr()));
ASSERT_SUCCESS(urProgramCreateWithBinary(
context, device, std::strlen(ptxSource), (const uint8_t *)ptxSource,
nullptr, program.ptr()));
ASSERT_NE(program, nullptr);
ASSERT_SUCCESS(urProgramBuild(context, program, nullptr));

Expand All @@ -218,9 +218,9 @@ TEST_P(cudaKernelTest, URKernelDispatch) {

TEST_P(cudaKernelTest, URKernelDispatchTwo) {
uur::raii::Program program = nullptr;
ASSERT_SUCCESS(urProgramCreateWithBinary(context, device, sizeof(ptxSource),
(const uint8_t *)twoParams,
nullptr, program.ptr()));
ASSERT_SUCCESS(urProgramCreateWithBinary(
context, device, std::strlen(ptxSource), (const uint8_t *)twoParams,
nullptr, program.ptr()));
ASSERT_NE(program, nullptr);
ASSERT_SUCCESS(urProgramBuild(context, program, nullptr));

Expand Down

0 comments on commit 3696d46

Please sign in to comment.