您可以在GPU上使用opencl分配大于设备内存的缓冲区吗? [英] Can you allocate a buffer that is larger than the device memory using opencl on a GPU
问题描述
是否可以分配大于设备内存(假定为GPU)的缓冲区?
Is it possible to allocate a buffer that is larger than the device memory (assuming a GPU)?
我很确定:
clCreateBuffer(context,CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR,sizeof(float) * DATA_SIZE, inputdata, NULL);
不起作用.但这不行吗?:
does not work. but shouldn't this work?:
clCreateBuffer(context,CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR,sizeof(float) * DATA_SIZE, inputdata, NULL);
我似乎很难将其与NVIDIA QUADRO FX 3800配合使用,但是我听说还有其他一些人成功地分配了比ATI卡上的设备内存更大的缓冲区.
I seem to be having trouble getting it to work with my NVIDIA QUADRO FX 3800, but I heard of others that have had success allocating a buffer larger than the device memory on ATI cards.
推荐答案
通常,您不能分配大于CL_DEVICE_MAX_MEM_ALLOC_SIZE的缓冲区,该缓冲区通常小于CL_DEVICE_GLOBAL_MEM_SIZE.我不知道如何在不将主机内存切成多个cl缓冲区的情况下规避此限制.
in general you can't allocate a buffer larger than CL_DEVICE_MAX_MEM_ALLOC_SIZE which is usually smaller as CL_DEVICE_GLOBAL_MEM_SIZE. I don't know any way how to circumvent this restriction without slicing the host memory into multiple cl buffers.
这篇关于您可以在GPU上使用opencl分配大于设备内存的缓冲区吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!