Explorar o código

SOCL: support SOCL_FORCE_DYNAMIC env var

Sylvain Henry %!s(int64=13) %!d(string=hai) anos
pai
achega
0b0abe0d4c
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      socl/src/cl_createcommandqueue.c

+ 5 - 1
socl/src/cl_createcommandqueue.c

@@ -53,7 +53,11 @@ soclCreateCommandQueue(cl_context                   context,
 
    cq->properties = properties;
    gc_entity_store(&cq->context, context);
-   cq->device = device;
+
+   char * fd = getenv("SOCL_FORCE_DYNAMIC");
+   int force_dynamic = fd == NULL ? 0 : atoi(fd);
+
+   cq->device = force_dynamic ? NULL : device;
 
    #ifdef DEBUG
    static int id = 0;