Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
[storage] use if
Browse files Browse the repository at this point in the history
  • Loading branch information
hotpxl committed Aug 11, 2015
1 parent b2bc69f commit 21674ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/mxnet/cuda_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <dmlc/logging.h>

#ifdef MXNET_USE_CUDA
#if MXNET_USE_CUDA

#include <cuda_runtime.h>
#include <cublas_v2.h>
Expand Down Expand Up @@ -100,7 +100,7 @@ inline const char* CurandGetErrorString(curandStatus_t status) {

#endif // MXNET_USE_CUDA

#ifdef MXNET_USE_CUDNN
#if MXNET_USE_CUDNN

#include <cudnn.h>

Expand Down
6 changes: 3 additions & 3 deletions src/storage/gpu_storage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
#include "./gpu_storage.h"
#include "mxnet/cuda_utils.h"
#ifdef MXNET_USE_CUDA
#if MXNET_USE_CUDA
#include <cuda_runtime.h>
#endif // MXNET_USE_CUDA

Expand All @@ -12,7 +12,7 @@ namespace storage {

void* GpuStorage::Alloc(size_t size) {
void* ret;
#ifdef MXNET_USE_CUDA
#if MXNET_USE_CUDA
CUDA_CALL(cudaMalloc(&ret, size));
#else // MXNET_USE_CUDA
LOG(FATAL) << "Please compile with CUDA enabled";
Expand All @@ -21,7 +21,7 @@ void* GpuStorage::Alloc(size_t size) {
}

void GpuStorage::Free(void* ptr) {
#ifdef MXNET_USE_CUDA
#if MXNET_USE_CUDA
CUDA_CALL(cudaFree(ptr));
#else // MXNET_USE_CUDA
LOG(FATAL) << "Please compile with CUDA enabled";
Expand Down

0 comments on commit 21674ef

Please sign in to comment.