Using AMD sample opencl test cases with a diffirent OpenCL compiler


I wished to use AMD OpenCL Sample test cases with a different OpenCL compiler. I installed the AMD samples test cases through the

installer available on AMD Opencl website. When I try to build OpenCLSamples project through MSVC I get the following error messages:

Error	1	error C2065: 'CL_MEM_USE_PERSISTENT_MEM_AMD' : undeclared identifier	d:\work\openclbm\amd app\samples\opencl\cl\app\binomialoptionmultigpu\binomialoptionmultigpu.cpp	366	BinomialOptionMultiGPU

This error message is generated from various other source files. I am assuming (may be wrong) this error message occurring because I do not have

AMDAPPSDKROOT set. I cannot set this environment variable because I do not wish to install the AMD opencl SDK.

Is there a workaround or has someone ever tried to build AMD opencl sample test cases with a different OpenCL compiler.



Simply add a define for CL_MEM_USE_PERSISTENT_MEM_AMD equaling to 0x40 as a work-around. However, the use of that define indicates that the sample program is using some AMD-specific extension to OpenCL that won’t work with another vender’s implementation anyway.

Are the set of outputs available so that users could compare them against there own generated results and determine if they are correct.


Found it. One must switch on the verify flag.