瀏覽代碼

SOCL: support SOCL_FORCE_DYNAMIC env var

Sylvain Henry 12 年之前
父節點
當前提交
0b0abe0d4c
共有 1 個文件被更改,包括 5 次插入1 次删除
  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;