SWDEV-493913 - Replaced calls to clGetExtensionFunctionAddress in ocltst

Replaced clGetExtensionFunctionAddress calls with
clGetExtensionFunctionAddressForPlatform to ensure
interoperability with distribution ICD loaders.

Change-Id: I560a62459f2ad222750e65e869b98d6b6ec56665
This commit is contained in:
Ioannis Assiouras
2024-11-11 22:05:40 +00:00
parent 24c57cb984
commit 9f1cc590d8
3 changed files with 21 additions and 19 deletions
+2 -2
View File
@@ -109,7 +109,6 @@ class App {
m_window(0), m_window(0),
m_platform(platform) { m_platform(platform) {
// initialize OCLWrapper reference // initialize OCLWrapper reference
m_wrapper = new OCLWrapper();
// m_workers = Set of worker objects that are used to run a subtest from a // m_workers = Set of worker objects that are used to run a subtest from a
// module // module
@@ -120,7 +119,8 @@ class App {
* Force caltst to use 1 thread at a time in Windows * Force caltst to use 1 thread at a time in Windows
* only contextual calls are thread safe currently * 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; // m_numDevices = 1;
// Report structure used to store the results of the tests // Report structure used to store the results of the tests
+1 -1
View File
@@ -103,7 +103,7 @@ typedef CL_API_ENTRY cl_int(CL_API_CALL *clSetDeviceClockModeAMD_fn)(
class OCLWrapper { class OCLWrapper {
public: public:
OCLWrapper(); OCLWrapper(cl_platform_id);
~OCLWrapper() {} ~OCLWrapper() {}
@@ -20,7 +20,7 @@
#include "OCLWrapper.h" #include "OCLWrapper.h"
OCLWrapper::OCLWrapper() { OCLWrapper::OCLWrapper(cl_platform_id platform) {
clEnqueueWaitSignalAMD_ptr = clEnqueueWaitSignalAMD_ptr =
(clEnqueueWaitSignalAMD_fn)clGetExtensionFunctionAddress( (clEnqueueWaitSignalAMD_fn)clGetExtensionFunctionAddress(
"clEnqueueWaitSignalAMD"); "clEnqueueWaitSignalAMD");
@@ -40,27 +40,29 @@ OCLWrapper::OCLWrapper() {
(clGetGLContextInfoKHR_fn)clGetExtensionFunctionAddress( (clGetGLContextInfoKHR_fn)clGetExtensionFunctionAddress(
"clGetGLContextInfoKHR"); "clGetGLContextInfoKHR");
clCreateFromGLBuffer_ptr = clCreateFromGLBuffer_ptr =
(clCreateFromGLBuffer_fn)clGetExtensionFunctionAddress( (clCreateFromGLBuffer_fn)clGetExtensionFunctionAddressForPlatform(
"clCreateFromGLBuffer"); platform, "clCreateFromGLBuffer");
clCreateFromGLTexture_ptr = clCreateFromGLTexture_ptr =
(clCreateFromGLTexture_fn)clGetExtensionFunctionAddress( (clCreateFromGLTexture_fn)clGetExtensionFunctionAddressForPlatform(
"clCreateFromGLTexture"); platform, "clCreateFromGLTexture");
clCreateFromGLTexture2D_ptr = clCreateFromGLTexture2D_ptr =
(clCreateFromGLTexture2D_fn)clGetExtensionFunctionAddress( (clCreateFromGLTexture2D_fn)clGetExtensionFunctionAddressForPlatform(
"clCreateFromGLTexture2D"); platform, "clCreateFromGLTexture2D");
clCreateFromGLRenderbuffer_ptr = clCreateFromGLRenderbuffer_ptr =
(clCreateFromGLRenderbuffer_fn)clGetExtensionFunctionAddress( (clCreateFromGLRenderbuffer_fn)clGetExtensionFunctionAddressForPlatform(
"clCreateFromGLRenderbuffer"); platform, "clCreateFromGLRenderbuffer");
clGetGLObjectInfo_ptr = clGetGLObjectInfo_ptr =
(clGetGLObjectInfo_fn)clGetExtensionFunctionAddress("clGetGLObjectInfo"); (clGetGLObjectInfo_fn)clGetExtensionFunctionAddressForPlatform(
clGetGLTextureInfo_ptr = (clGetGLTextureInfo_fn)clGetExtensionFunctionAddress( platform, "clGetGLObjectInfo");
"clGetGLTextureInfo"); clGetGLTextureInfo_ptr =
(clGetGLTextureInfo_fn)clGetExtensionFunctionAddressForPlatform(
platform, "clGetGLTextureInfo");
clEnqueueAcquireGLObjects_ptr = clEnqueueAcquireGLObjects_ptr =
(clEnqueueAcquireGLObjects_fn)clGetExtensionFunctionAddress( (clEnqueueAcquireGLObjects_fn)clGetExtensionFunctionAddressForPlatform(
"clEnqueueAcquireGLObjects"); platform, "clEnqueueAcquireGLObjects");
clEnqueueReleaseGLObjects_ptr = clEnqueueReleaseGLObjects_ptr =
(clEnqueueReleaseGLObjects_fn)clGetExtensionFunctionAddress( (clEnqueueReleaseGLObjects_fn)clGetExtensionFunctionAddressForPlatform(
"clEnqueueReleaseGLObjects"); platform, "clEnqueueReleaseGLObjects");
// Performance counter function pointers // Performance counter function pointers
clCreatePerfCounterAMD_ptr = clCreatePerfCounterAMD_ptr =