Fixed generators to better account for the lack of return value of clSVMFree. (#139)
authorBrice Videau <bvideau@anl.gov>
Fri, 5 Feb 2021 17:05:27 +0000 (11:05 -0600)
committerGitHub <noreply@github.com>
Fri, 5 Feb 2021 17:05:27 +0000 (09:05 -0800)
* Fixed generators to better account for the lack of return value of clSVMFree.

* Added generated file.

loader/icd_dispatch_generated.c
scripts/icd_dispatch_generated.c.mako
scripts/icd_print_layer_generated.c.mako
test/layer/icd_print_layer_generated.c

index deced70..17f9f46 100644 (file)
@@ -4246,9 +4246,12 @@ CL_API_ENTRY void CL_API_CALL clSVMFree(
 {
 #if defined(CL_ENABLE_LAYERS)
     if (khrFirstLayer)
-        return khrFirstLayer->dispatch.clSVMFree(
+    {
+        khrFirstLayer->dispatch.clSVMFree(
             context,
             svm_pointer);
+        return;
+    }
 #endif // defined(CL_ENABLE_LAYERS)
     if (context == NULL) return;
     context->dispatch->clSVMFree(
index a05802b..6260ce3 100644 (file)
@@ -78,7 +78,12 @@ ${("", "static ")[disp]}CL_API_ENTRY ${api.RetType} CL_API_CALL ${api.Name + (""
 %if disp == 0:
 #if defined(CL_ENABLE_LAYERS)
     if (khrFirstLayer)
+%  if api.Name == "clSVMFree":
+    {
+        khrFirstLayer->dispatch.${api.Name}(
+%  else:
         return khrFirstLayer->dispatch.${api.Name}(
+%  endif
 %for i, param in enumerate(api.Params):
 %  if i < len(api.Params)-1:
             ${param.Name},
@@ -86,6 +91,10 @@ ${("", "static ")[disp]}CL_API_ENTRY ${api.RetType} CL_API_CALL ${api.Name + (""
             ${param.Name});
 %  endif
 %endfor
+%  if api.Name == "clSVMFree":
+        return;
+    }
+%  endif
 #endif // defined(CL_ENABLE_LAYERS)
 %endif
 %if api.RetType in apihandles or api.RetType == "void*":
index f5260d5..4cfd784 100644 (file)
@@ -32,7 +32,11 @@ static CL_API_ENTRY ${api.RetType} CL_API_CALL ${api.Name + "_wrap"}(
 %endfor
 {
 printf("${api.Name}\n");
+%  if api.Name == "clSVMFree":
+tdispatch->${api.Name}(
+%  else:
 return tdispatch->${api.Name}(
+%  endif
 %for i, param in enumerate(api.Params):
 %  if i < len(api.Params)-1:
             ${param.Name},
index 2cbb3ee..8633e0b 100644 (file)
@@ -1604,7 +1604,7 @@ static CL_API_ENTRY void CL_API_CALL clSVMFree_wrap(
     void* svm_pointer) CL_API_SUFFIX__VERSION_2_0
 {
 printf("clSVMFree\n");
-return tdispatch->clSVMFree(
+tdispatch->clSVMFree(
             context,
             svm_pointer);
 }