File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 29
29
30
30
#ifdef USE_OPENCL
31
31
32
+ #include < cstdio>
33
+ #include < vector>
34
+
35
+ #include " errcode.h" // for ASSERT_HOST
32
36
#include " opencl_device_selection.h"
33
37
GPUEnv OpenclDevice::gpuEnv;
34
38
@@ -758,14 +762,16 @@ int OpenclDevice::ReleaseOpenclRunEnv()
758
762
#endif
759
763
return 1 ;
760
764
}
765
+
761
766
inline int OpenclDevice::AddKernelConfig ( int kCount , const char *kName )
762
767
{
763
- if ( kCount < 1 )
764
- fprintf (stderr, " Error: ( KCount < 1 ) AddKernelConfig \n " );
768
+ ASSERT_HOST ( kCount > 0 );
769
+ ASSERT_HOST ( strlen ( kName ) < sizeof (gpuEnv. mArrykernelNames [ kCount - 1 ]) );
765
770
strcpy ( gpuEnv.mArrykernelNames [kCount -1 ], kName );
766
771
gpuEnv.mnKernelCount ++;
767
772
return 0 ;
768
773
}
774
+
769
775
int OpenclDevice::RegistOpenclKernel ()
770
776
{
771
777
if ( !gpuEnv.mnIsUserCreated )
You can’t perform that action at this time.
0 commit comments