Browse Source

SOCL: support SOCL_FORCE_DYNAMIC env var

Sylvain Henry 12 years ago
parent
commit
0b0abe0d4c
1 changed files with 5 additions and 1 deletions
  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;