Skip to content

Commit

Permalink
[SYCLomatic] Fix incorrect test for texture types (#2328)
Browse files Browse the repository at this point in the history
  • Loading branch information
the-slow-one authored Sep 5, 2024
1 parent 0cd3def commit a5a5ae6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
12 changes: 6 additions & 6 deletions clang/lib/DPCT/ASTTraversal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13162,12 +13162,12 @@ void TextureRule::registerMatcher(MatchFinder &MF) {
this);

MF.addMatcher(
declRefExpr(
to(enumConstantDecl(hasType(enumDecl(hasAnyName(
"cudaTextureAddressMode", "cudaTextureFilterMode",
"cudaChannelFormatKind", "cudaResourceType",
"CUarray_format_enum", "CUaddress_mode_enum",
"CUfilter_mode_enum"))))))
declRefExpr(to(enumConstantDecl(hasType(enumDecl(hasAnyName(
"cudaTextureAddressMode", "cudaTextureFilterMode",
"cudaChannelFormatKind", "cudaResourceType",
"CUarray_format_enum", "CUaddress_mode_enum",
"CUfilter_mode_enum"))))))

.bind("texEnum"),
this);

Expand Down
16 changes: 11 additions & 5 deletions clang/test/dpct/texture_driver.cu
Original file line number Diff line number Diff line change
Expand Up @@ -225,18 +225,24 @@ void test_texref() {
cuTexRefSetAddress2D(tex, &desc, dptr, b);
}

// CHECK: sycl::addressing_mode AddrMode[] = {
// CHECK-NEXT: sycl::addressing_mode::repeat, sycl::addressing_mode::clamp_to_edge,
// CHECK-NEXT: sycl::addressing_mode::clamp};
// CHECK: sycl::addressing_mode AddrMode[] =
// CHECK-NEXT: {
// CHECK-NEXT: sycl::addressing_mode::repeat,
// CHECK-NEXT: sycl::addressing_mode::clamp_to_edge,
// CHECK-NEXT: sycl::addressing_mode::clamp
// CHECK-NEXT: };
CUaddress_mode AddrMode[] =
{
CU_TR_ADDRESS_MODE_WRAP,
CU_TR_ADDRESS_MODE_CLAMP,
CU_TR_ADDRESS_MODE_BORDER
};

// CHECK: sycl::filtering_mode FltMode[] = {
// CHECK-NEXT: sycl::filtering_mode::nearest, sycl::filtering_mode::linear};
// CHECK: sycl::filtering_mode FltMode[] =
// CHECK-NEXT: {
// CHECK-NEXT: sycl::filtering_mode::nearest,
// CHECK-NEXT: sycl::filtering_mode::linear
// CHECK-NEXT: };
CUfilter_mode FltMode[] =
{
CU_TR_FILTER_MODE_POINT,
Expand Down

0 comments on commit a5a5ae6

Please sign in to comment.