File tree Expand file tree Collapse file tree 2 files changed +30
-8
lines changed Expand file tree Collapse file tree 2 files changed +30
-8
lines changed Original file line number Diff line number Diff line change @@ -176,21 +176,32 @@ void makeGemmKernel(
176
176
if (*kernelBinary) {
177
177
#ifdef AUTOGEMM_PRINT_DEBUG
178
178
printf (" makeGemmKernel: pre-compiled binary found: %llu bytes\n " , *kernelBinarySize);
179
+ printf (" makeGemmKernel: Creating program from binary\n " );
179
180
#endif
180
181
clProgram = clCreateProgramWithBinary (
181
182
clContext,
182
183
1 , &clDevice,
183
184
kernelBinarySize, kernelBinary,
184
185
&clBinaryStatus, &err );
185
- CL_CHECK (err)
186
+ #ifdef AUTOGEMM_PRINT_DEBUG
187
+ if (err != CL_SUCCESS) {
188
+ printf (" makeGemmKernel: Failed to create program with binary\n " );
189
+ }
190
+ #endif
186
191
err = clBuildProgram (
187
192
clProgram,
188
193
1 , &clDevice,
189
194
binaryBuildOptions, NULL , NULL );
190
- CL_CHECK (err)
191
- } else {
192
195
#ifdef AUTOGEMM_PRINT_DEBUG
193
- printf (" makeGemmKernel: Creating program from source\n " , *kernelBinarySize);
196
+ if (err != CL_SUCCESS) {
197
+ printf (" makeGemmKernel: Failed to build program from binary\n " );
198
+ }
199
+ #endif
200
+ }
201
+
202
+ if (!*kernelBinary || err != CL_SUCCESS) {
203
+ #ifdef AUTOGEMM_PRINT_DEBUG
204
+ printf (" makeGemmKernel: Creating program from source\n " );
194
205
#endif
195
206
clProgram = clCreateProgramWithSource (
196
207
clContext,
Original file line number Diff line number Diff line change @@ -189,21 +189,32 @@ void makeKernel(
189
189
if (*kernelBinary) {
190
190
#ifdef AUTOGEMM_PRINT_DEBUG
191
191
printf (" makeKernel: pre-compiled binary found: %llu bytes\n " , *kernelBinarySize);
192
+ printf (" makeKernel: Creating program from binary\n " );
192
193
#endif
193
194
clProgram = clCreateProgramWithBinary (
194
195
clContext,
195
196
1 , &clDevice,
196
197
kernelBinarySize, kernelBinary,
197
198
&clBinaryStatus, &err );
198
- CL_CHECK (err)
199
+ #ifdef AUTOGEMM_PRINT_DEBUG
200
+ if (err != CL_SUCCESS) {
201
+ printf (" makeKernel: Failed to create program with binary\n " );
202
+ }
203
+ #endif
199
204
err = clBuildProgram (
200
205
clProgram,
201
206
1 , &clDevice,
202
207
binaryBuildOptions, NULL , NULL );
203
- CL_CHECK (err)
204
- } else {
205
208
#ifdef AUTOGEMM_PRINT_DEBUG
206
- printf (" makeKernel: Creating program from source\n " , *kernelBinarySize);
209
+ if (err != CL_SUCCESS) {
210
+ printf (" makeKernel: Failed to build program from binary\n " );
211
+ }
212
+ #endif
213
+ }
214
+
215
+ if (!*kernelBinary || err != CL_SUCCESS) {
216
+ #ifdef AUTOGEMM_PRINT_DEBUG
217
+ printf (" makeKernel: Creating program from source\n " );
207
218
#endif
208
219
clProgram = clCreateProgramWithSource (
209
220
clContext,
You can’t perform that action at this time.
0 commit comments