| 32 | #include <string.h> |
| 33 | |
| 34 | cudaError_t setProp(CUmemAllocationProp *prop, bool UseCompressibleMemory) |
| 35 | { |
| 36 | CUdevice currentDevice; |
| 37 | if (cuCtxGetDevice(¤tDevice) != CUDA_SUCCESS) |
| 38 | return cudaErrorMemoryAllocation; |
| 39 | |
| 40 | memset(prop, 0, sizeof(CUmemAllocationProp)); |
| 41 | prop->type = CU_MEM_ALLOCATION_TYPE_PINNED; |
| 42 | prop->location.type = CU_MEM_LOCATION_TYPE_DEVICE; |
| 43 | prop->location.id = currentDevice; |
| 44 | |
| 45 | if (UseCompressibleMemory) |
| 46 | prop->allocFlags.compressionType = CU_MEM_ALLOCATION_COMP_GENERIC; |
| 47 | |
| 48 | return cudaSuccess; |
| 49 | } |
| 50 | |
| 51 | cudaError_t allocateCompressible(void **adr, size_t size, bool UseCompressibleMemory) |
| 52 | { |
no outgoing calls
no test coverage detected