@@ -21,7 +21,7 @@ __global__ void textureFilterKernel(hipTextureObject_t texObj, float *output,
2121 float v = (float )(y + fy + 0 .5f ) / height;
2222
2323 // Texture automatically handles boundary conditions and interpolation
24- float value = tex2D <float >(texObj, u, v);
24+ float value = hipTex2D <float >(texObj, u, v);
2525 sum += value;
2626 }
2727 }
@@ -42,7 +42,7 @@ __global__ void textureTranspose(hipTextureObject_t texObj, float *output,
4242 float v = (y + 0 .5f ) / height;
4343
4444 // Fetch using texture cache
45- float value = tex2D <float >(texObj, u, v);
45+ float value = hipTex2D <float >(texObj, u, v);
4646
4747 // Write transposed
4848 if (y < width && x < height) {
@@ -71,7 +71,7 @@ __global__ void bilinearInterpolation(hipTextureObject_t texObj, float *output,
7171 float v = src_y / in_height;
7272
7373 // Hardware bilinear interpolation
74- float interpolated = tex2D <float >(texObj, u, v);
74+ float interpolated = hipTex2D <float >(texObj, u, v);
7575
7676 output[y * out_width + x] = interpolated;
7777 }
@@ -134,7 +134,7 @@ __global__ void amdOptimizedTextureAccess(hipTextureObject_t texObj, float *outp
134134 float u = (x + 0 .5f ) / width;
135135 float v = (y + 0 .5f ) / height;
136136
137- float value = tex2D <float >(texObj, u, v);
137+ float value = hipTex2D <float >(texObj, u, v);
138138 output[pixel_id] = value;
139139 }
140140 }
@@ -293,10 +293,10 @@ void demonstrateTextureMemory() {
293293 HIP_CHECK (hipEventDestroy (start));
294294 HIP_CHECK (hipEventDestroy (stop));
295295
296- hipFree (d_input);
297- hipFree (d_output_texture);
298- hipFree (d_output_manual);
299- hipFree (d_resized);
296+ HIP_CHECK ( hipFree (d_input) );
297+ HIP_CHECK ( hipFree (d_output_texture) );
298+ HIP_CHECK ( hipFree (d_output_manual) );
299+ HIP_CHECK ( hipFree (d_resized) );
300300
301301 free (h_input);
302302 free (h_output_texture);
0 commit comments