Skip to content

Commit

Permalink
fix openmp
Browse files Browse the repository at this point in the history
  • Loading branch information
winstywang committed Apr 1, 2015
1 parent cfe7bdf commit 0b436d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ else
endif

ifeq ($(USE_OPENMP_ITER), 1)
CFLAGS += -fopenmp
CFLAGS += -fopenmp -DCXXNET_USE_OPENMP=1
else
CFLAGS += -DCXXNET_USE_OPENMP=0
endif
# customize cudnn path
ifneq ($(USE_CUDNN_PATH), NONE)
Expand Down
4 changes: 1 addition & 3 deletions src/utils/omp.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
* \brief header to handle OpenMP compatibility issues
* \author Tianqi Chen
*/
#if defined(_OPENMP)
#if CXXNET_USE_OPENMP
#include <omp.h>
#else
#ifndef DISABLE_OPENMP
// use pragma message instead of warning
#pragma message ("Warning: OpenMP is not available, inst iter will be compiled into single-thread code. Use OpenMP-enabled compiler to get benefit of multi-threading")
#endif
inline int omp_get_thread_num() { return 0; }
inline int omp_get_num_threads() { return 1; }
inline void omp_set_num_threads(int nthread) {}
Expand Down

0 comments on commit 0b436d0

Please sign in to comment.