From c971b263c1caf48503cfeff42d2960193348dcee Mon Sep 17 00:00:00 2001 From: Rahul Garg Date: Sun, 19 Nov 2017 22:10:46 +0530 Subject: [PATCH] Update hipModuleGetTexRef API [ROCm/hip-tests commit: 741702888f678b6b772b88f1c35aa6609a32e8d7] --- .../11_texture_driver/texture2dDrv.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/projects/hip-tests/samples/2_Cookbook/11_texture_driver/texture2dDrv.cpp b/projects/hip-tests/samples/2_Cookbook/11_texture_driver/texture2dDrv.cpp index 73f59eacf8..36030932d0 100644 --- a/projects/hip-tests/samples/2_Cookbook/11_texture_driver/texture2dDrv.cpp +++ b/projects/hip-tests/samples/2_Cookbook/11_texture_driver/texture2dDrv.cpp @@ -71,13 +71,15 @@ bool runTest(int argc, char **argv) copyParam.widthInBytes = copyParam.srcPitch; copyParam.height = height; hipMemcpy_2D(©Param); - - hipTexRefSetAddressMode(&tex, 0, hipAddressModeWrap); - hipTexRefSetAddressMode(&tex, 1, hipAddressModeWrap); - hipTexRefSetFilterMode(&tex, hipFilterModePoint); - hipTexRefSetFlags(&tex, 0); - hipTexRefSetFormat(&tex, HIP_AD_FORMAT_FLOAT, 1); - hipTexRefSetArray(&tex, array, HIP_TRSA_OVERRIDE_FORMAT); + + textureReference* texref; + hipModuleGetTexRef(&texref, Module, "tex"); + hipTexRefSetAddressMode(texref, 0, hipAddressModeWrap); + hipTexRefSetAddressMode(texref, 1, hipAddressModeWrap); + hipTexRefSetFilterMode(texref, hipFilterModePoint); + hipTexRefSetFlags(texref, 0); + hipTexRefSetFormat(texref, HIP_AD_FORMAT_FLOAT, 1); + hipTexRefSetArray(texref, array, HIP_TRSA_OVERRIDE_FORMAT); float* dData = NULL; hipMalloc((void **) &dData, size);