Skip to content

Commit c0caaec

Browse files
authored
[SYCL][Bindless] Remove deprecation warning from sycl::fract (#11162)
This PR remove the deprecation warning from using `sycl::fract` with raw pointer in test `read_sampled.cpp`by the use of `multi_ptr` as argument.
1 parent fb1d712 commit c0caaec

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sycl/test-e2e/bindless_images/read_sampled.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,14 @@ struct util {
5959
int *x1) {
6060
double pixelCoord;
6161

62+
// sycl::fract stores results into a multi_ptr instead of a raw pointer.
63+
sycl::private_ptr<double> pPixelCoord = &pixelCoord;
64+
6265
// Subtract to align so that pixel center is 0.5 away from origin.
6366
coord = coord - 0.5;
6467

65-
double weight = sycl::fract(coord, &pixelCoord);
66-
*x0 = static_cast<int>(std::floor(pixelCoord));
68+
double weight = sycl::fract(coord, pPixelCoord);
69+
*x0 = static_cast<int>(*pPixelCoord);
6770
*x1 = *x0 + 1;
6871
return weight;
6972
}

0 commit comments

Comments
 (0)