简体   繁体   中英

Why Global memory allocation is successful with the size more than the limit in GPU?

I am experimenting with Vivante GPU GC2000 Series, where the clinfo produced the below result.

 CL_DEVICE_GLOBAL_MEM_SIZE:             64 MByte
 CL_DEVICE_MAX_MEM_ALLOC_SIZE:          32 MByte
 CL_DEVICE_GLOBAL_MEM_CACHE_TYPE:       Read/Write
 CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE:       64
 CL_DEVICE_GLOBAL_MEM_CACHE_SIZE:       4096
 CL_DEVICE_LOCAL_MEM_SIZE:          1 KByte
 CL_DEVICE_LOCAL_MEM_TYPE:          Global
 CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE:        4 KByte
 CL_DEVICE_MAX_CONSTANT_ARGS:           9

From above output, it is clear that 64MByte is the limit for Global Memory allocation.

Now, when I tried allocating 900Mbytes global size, i have not received any error and it is successful.

int noOfBytes = (900 * 1024 * 1024);
memPtr = clCreateBuffer(context, CL_MEM_READ_WRITE, noOfBytes, NULL, &err);
 if ( err != CL_SUCESS) {
    printf ("Ooops.. Failed");
  }

Sounds this experiment is show proving what the clinfo claims. Am i missing any theory or something else ?

Because buffers and images are allocated on an OpenCL context (not an OpenCL device ) the actual device allocation is often deferred until the buffer is used on a specific device. So while this allocation seemed to work, if you try to actually use that buffer on your device, you'll get an error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM