Skip to content

Commit b46cf76

Browse files
committed
Reduce required memory for python compilation
1 parent b43c6fe commit b46cf76

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ if (${SKBUILD})
140140
set(LIBRAPID_USE_CUDA ON)
141141
set(LIBRAPID_USE_OPENCL ON)
142142
set(LIBRAPID_NATIVE_ARCH ON)
143+
else()
144+
set(LIBRAPID_NO_ALWAYS_INLINE ON) # Reduce compile memory
143145
endif ()
144146

145147
set(LIBRAPID_USE_OMP ON)
@@ -339,7 +341,7 @@ if (LIBRAPID_USE_OPENCL)
339341

340342
# Define CL_HPP_TARGET_OPENCL_VERSION to the version of OpenCL being used
341343
message(STATUS "[ LIBRAPID ] OpenCL Version: ${OpenCL_VERSION_MAJOR}${OpenCL_VERSION_MINOR}0")
342-
set(OpenCLVersion ${OpenCL_VERSION_MAJOR} ${OpenCL_VERSION_MINOR}0)
344+
set(OpenCLVersion ${OpenCL_VERSION_MAJOR}${OpenCL_VERSION_MINOR}0)
343345
target_compile_definitions(${module_name} PUBLIC CL_HPP_TARGET_OPENCL_VERSION=${OpenCLVersion})
344346
target_compile_definitions(${module_name} PUBLIC CL_HPP_MINIMUM_OPENCL_VERSION=${OpenCLVersion})
345347

librapid/include/librapid/core/gnuConfig.hpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
#define LIBRAPID_CORE_GNU_CONFIG_HPP
33

44
#define LIBRAPID_INLINE inline
5-
#define LIBRAPID_ALWAYS_INLINE inline __attribute__((always_inline))
5+
6+
#if defined(LIBRAPID_NO_ALWAYS_INLINE)
7+
# define LIBRAPID_ALWAYS_INLINE inline
8+
#else
9+
# define LIBRAPID_ALWAYS_INLINE inline __attribute__((always_inline))
10+
#endif
611

712
#if defined(LIBRAPID_ENABLE_ASSERT)
813

librapid/include/librapid/core/msvcConfig.hpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
#define LIBRAPID_CORE_MSVC_CONFIG_HPP
33

44
#define LIBRAPID_INLINE inline
5-
#define LIBRAPID_ALWAYS_INLINE inline __forceinline
5+
6+
#if defined(LIBRAPID_NO_ALWAYS_INLINE)
7+
# define LIBRAPID_ALWAYS_INLINE inline
8+
#else
9+
# define LIBRAPID_ALWAYS_INLINE inline __forceinline
10+
#endif
611

712
#if defined(LIBRAPID_ENABLE_ASSERT)
813

0 commit comments

Comments
 (0)