Skip to content
Snippets Groups Projects
Unverified Commit 8b077d5f authored by Recolic Keghart's avatar Recolic Keghart
Browse files

sync

parent dd51ce2f
No related branches found
No related tags found
No related merge requests found
...@@ -113,7 +113,7 @@ namespace rlib { ...@@ -113,7 +113,7 @@ namespace rlib {
private: private:
__host__ void apply_new_cap() { __host__ void apply_new_cap() {
void *new_mem; void *new_mem;
rlib::cuda_assert(cudaMalloc(&new_mem, cap)); rlib::cuda_assert(cudaMallocManaged(&new_mem, cap));
if(new_mem == nullptr) if(new_mem == nullptr)
throw std::runtime_error("Failed to allocate memory."); throw std::runtime_error("Failed to allocate memory.");
if(mem != nullptr) { if(mem != nullptr) {
...@@ -125,7 +125,7 @@ namespace rlib { ...@@ -125,7 +125,7 @@ namespace rlib {
__device__ bool dev_apply_new_cap() { __device__ bool dev_apply_new_cap() {
void *new_mem = nullptr; void *new_mem = nullptr;
rlib::dev_cuda_assert(cudaMalloc(&new_mem, cap)); rlib::dev_cuda_assert(cudaMallocManaged(&new_mem, cap));
if(new_mem == nullptr) if(new_mem == nullptr)
return false; return false;
if(mem != nullptr) { if(mem != nullptr) {
......
...@@ -8,7 +8,7 @@ namespace rlib { ...@@ -8,7 +8,7 @@ namespace rlib {
} }
__device__ bool dev_cuda_assert(cudaError_t err) { __device__ bool dev_cuda_assert(cudaError_t err) {
if(err != cudaError::cudaSuccess) { if(err != cudaError::cudaSuccess) {
printf("FUCK! CUDA runtime error: %d, %s\n", err, cudaGetErrorString(err)); printf("FUCK! CUDA runtime error: %d, %s\n", err, "fuck");//cudaGetErrorString(err));
return false; return false;
} }
return true; return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment