diff --git a/opencl/tests/ocltst/env/ocltst.cpp b/opencl/tests/ocltst/env/ocltst.cpp index 895038309a..05b368c460 100644 --- a/opencl/tests/ocltst/env/ocltst.cpp +++ b/opencl/tests/ocltst/env/ocltst.cpp @@ -109,7 +109,6 @@ class App { m_window(0), m_platform(platform) { // initialize OCLWrapper reference - m_wrapper = new OCLWrapper(); // m_workers = Set of worker objects that are used to run a subtest from a // module @@ -120,7 +119,8 @@ class App { * Force caltst to use 1 thread at a time in Windows * only contextual calls are thread safe currently */ - m_numDevices = findAdapters(m_platform, m_useCPU, NULL); + m_numDevices = findAdapters(m_platform, m_useCPU, &mpform_id); + m_wrapper = new OCLWrapper(mpform_id); // m_numDevices = 1; // Report structure used to store the results of the tests diff --git a/opencl/tests/ocltst/include/OCLWrapper.h b/opencl/tests/ocltst/include/OCLWrapper.h index 521a5fc50f..d1045fdb24 100644 --- a/opencl/tests/ocltst/include/OCLWrapper.h +++ b/opencl/tests/ocltst/include/OCLWrapper.h @@ -103,7 +103,7 @@ typedef CL_API_ENTRY cl_int(CL_API_CALL *clSetDeviceClockModeAMD_fn)( class OCLWrapper { public: - OCLWrapper(); + OCLWrapper(cl_platform_id); ~OCLWrapper() {} diff --git a/opencl/tests/ocltst/module/common/OCLWrapper.cpp b/opencl/tests/ocltst/module/common/OCLWrapper.cpp index df65dedeb4..cb21455840 100644 --- a/opencl/tests/ocltst/module/common/OCLWrapper.cpp +++ b/opencl/tests/ocltst/module/common/OCLWrapper.cpp @@ -20,7 +20,7 @@ #include "OCLWrapper.h" -OCLWrapper::OCLWrapper() { +OCLWrapper::OCLWrapper(cl_platform_id platform) { clEnqueueWaitSignalAMD_ptr = (clEnqueueWaitSignalAMD_fn)clGetExtensionFunctionAddress( "clEnqueueWaitSignalAMD"); @@ -40,27 +40,29 @@ OCLWrapper::OCLWrapper() { (clGetGLContextInfoKHR_fn)clGetExtensionFunctionAddress( "clGetGLContextInfoKHR"); clCreateFromGLBuffer_ptr = - (clCreateFromGLBuffer_fn)clGetExtensionFunctionAddress( - "clCreateFromGLBuffer"); + (clCreateFromGLBuffer_fn)clGetExtensionFunctionAddressForPlatform( + platform, "clCreateFromGLBuffer"); clCreateFromGLTexture_ptr = - (clCreateFromGLTexture_fn)clGetExtensionFunctionAddress( - "clCreateFromGLTexture"); + (clCreateFromGLTexture_fn)clGetExtensionFunctionAddressForPlatform( + platform, "clCreateFromGLTexture"); clCreateFromGLTexture2D_ptr = - (clCreateFromGLTexture2D_fn)clGetExtensionFunctionAddress( - "clCreateFromGLTexture2D"); + (clCreateFromGLTexture2D_fn)clGetExtensionFunctionAddressForPlatform( + platform, "clCreateFromGLTexture2D"); clCreateFromGLRenderbuffer_ptr = - (clCreateFromGLRenderbuffer_fn)clGetExtensionFunctionAddress( - "clCreateFromGLRenderbuffer"); + (clCreateFromGLRenderbuffer_fn)clGetExtensionFunctionAddressForPlatform( + platform, "clCreateFromGLRenderbuffer"); clGetGLObjectInfo_ptr = - (clGetGLObjectInfo_fn)clGetExtensionFunctionAddress("clGetGLObjectInfo"); - clGetGLTextureInfo_ptr = (clGetGLTextureInfo_fn)clGetExtensionFunctionAddress( - "clGetGLTextureInfo"); + (clGetGLObjectInfo_fn)clGetExtensionFunctionAddressForPlatform( + platform, "clGetGLObjectInfo"); + clGetGLTextureInfo_ptr = + (clGetGLTextureInfo_fn)clGetExtensionFunctionAddressForPlatform( + platform, "clGetGLTextureInfo"); clEnqueueAcquireGLObjects_ptr = - (clEnqueueAcquireGLObjects_fn)clGetExtensionFunctionAddress( - "clEnqueueAcquireGLObjects"); + (clEnqueueAcquireGLObjects_fn)clGetExtensionFunctionAddressForPlatform( + platform, "clEnqueueAcquireGLObjects"); clEnqueueReleaseGLObjects_ptr = - (clEnqueueReleaseGLObjects_fn)clGetExtensionFunctionAddress( - "clEnqueueReleaseGLObjects"); + (clEnqueueReleaseGLObjects_fn)clGetExtensionFunctionAddressForPlatform( + platform, "clEnqueueReleaseGLObjects"); // Performance counter function pointers clCreatePerfCounterAMD_ptr =