From 40bbefd3aa1e52863e89756f110305048ea6dc60 Mon Sep 17 00:00:00 2001
From: foreman
Date: Mon, 21 Mar 2016 17:51:06 -0400
Subject: [PATCH] P4 to Git Change 1249491 by gandryey@gera-w8 on 2016/03/21
17:37:48
SWDEV-90408 - OpenCL runtime crashes when querying CL_PROGRAM_NUM_KERNELS on a program built with clCompileProgram
- The app attempts to get query before build/link call. Make sure symbols are available.
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_program.cpp#40 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/program.hpp#39 edit
[ROCm/clr commit: c2b98ee5001536c4388903ee0a5b34d00acf699f]
---
projects/clr/opencl/api/opencl/amdocl/cl_program.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/projects/clr/opencl/api/opencl/amdocl/cl_program.cpp b/projects/clr/opencl/api/opencl/amdocl/cl_program.cpp
index 68071222f0..ac7c3ddf93 100644
--- a/projects/clr/opencl/api/opencl/amdocl/cl_program.cpp
+++ b/projects/clr/opencl/api/opencl/amdocl/cl_program.cpp
@@ -1049,6 +1049,9 @@ RUNTIME_ENTRY(cl_int, clGetProgramInfo, (
return CL_SUCCESS;
}
case CL_PROGRAM_NUM_KERNELS: {
+ if (as_amd(program)->symbolsPtr() == NULL) {
+ return CL_INVALID_PROGRAM_EXECUTABLE;
+ }
size_t numKernels = as_amd(program)->symbols().size();
return amd::clGetInfo(
numKernels, param_value_size, param_value, param_value_size_ret);