Unverified Commit ceb6265f authored by Pengfei Shi's avatar Pengfei Shi Committed by GitHub
Browse files

Add support for cuda version less then 10.0 (#3431)

parent 12e220b7
...@@ -65,9 +65,15 @@ struct CHAllocator { ...@@ -65,9 +65,15 @@ struct CHAllocator {
if (LGBM_config_::current_device == lgbm_device_cuda) { if (LGBM_config_::current_device == lgbm_device_cuda) {
cudaPointerAttributes attributes; cudaPointerAttributes attributes;
cudaPointerGetAttributes(&attributes, p); cudaPointerGetAttributes(&attributes, p);
#if CUDA_VERSION >= 10000
if ((attributes.type == cudaMemoryTypeHost) && (attributes.devicePointer != NULL)) { if ((attributes.type == cudaMemoryTypeHost) && (attributes.devicePointer != NULL)) {
cudaFreeHost(p); cudaFreeHost(p);
} }
#else
if ((attributes.memoryType == cudaMemoryTypeHost) && (attributes.devicePointer != NULL)) {
cudaFreeHost(p);
}
#endif
} else { } else {
_mm_free(p); _mm_free(p);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment