Skip to content

Commit 20196b9

Browse files
author
Diptorup Deb
committed
Rename CMake flags to have an IMEX prefix. Update all impacted files.
1 parent 5a3652d commit 20196b9

File tree

10 files changed

+23
-21
lines changed

10 files changed

+23
-21
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ CMakeLists.txt.user
175175

176176
# Build dir
177177
/cmake_build
178+
_build
179+
_install
178180

179181
# pip wheels
180182
*.whl

dpcomp_runtime/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ project(dpcomp-runtime LANGUAGES CXX C)
1616

1717
include(GenerateExportHeader)
1818

19-
if(TBB_ENABLE)
19+
if(IMEX_ENABLE_TBB_SUPPORT)
2020
find_package(TBB REQUIRED)
2121
endif()
2222

@@ -39,7 +39,7 @@ target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE
3939
${PROJECT_BINARY_DIR}
4040
)
4141

42-
if(TBB_ENABLE)
43-
target_compile_definitions(${PROJECT_NAME} PRIVATE TBB_ENABLE=1)
42+
if(IMEX_ENABLE_TBB_SUPPORT)
43+
target_compile_definitions(${PROJECT_NAME} PRIVATE IMEX_ENABLE_TBB_SUPPORT=1)
4444
target_link_libraries(${PROJECT_NAME} TBB::tbb)
4545
endif()

dpcomp_runtime/lib/tbb_parallel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifdef TBB_ENABLE
15+
#ifdef IMEX_ENABLE_TBB_SUPPORT
1616

1717
#include <array>
1818
#include <cassert>
@@ -246,4 +246,4 @@ DPCOMP_RUNTIME_EXPORT void dpcompParallelFinalize() {
246246
globalContext.reset();
247247
}
248248
}
249-
#endif // TBB_ENABLE
249+
#endif // IMEX_ENABLE_TBB_SUPPORT

mlir/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ add_subdirectory(include/mlir-extensions/dialect/plier)
4141
add_subdirectory(include/mlir-extensions/dialect/plier_util)
4242
add_subdirectory(include/mlir-extensions/dialect/gpu_runtime/IR)
4343

44-
if (GPU_ENABLE)
44+
if (IMEX_ENABLE_IGPU_DIALECT)
4545
add_subdirectory(tools)
4646
endif()
4747

numba_dpcomp/numba_dpcomp/math_runtime/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE
3131
${PROJECT_BINARY_DIR}
3232
)
3333

34-
if(DPNP_ENABLE)
34+
if(IMEX_USE_DPNP)
3535
target_include_directories(${PROJECT_NAME} PRIVATE
3636
${DPNP_INCLUDE_DIR}
3737
)
@@ -45,5 +45,5 @@ if(DPNP_ENABLE)
4545
INSTALL_RPATH "${DPNP_RPATH}"
4646
)
4747

48-
target_compile_definitions(${PROJECT_NAME} PRIVATE DPNP_ENABLE=1)
48+
target_compile_definitions(${PROJECT_NAME} PRIVATE IMEX_USE_DPNP=1)
4949
endif()

numba_dpcomp/numba_dpcomp/math_runtime/lib/numpy_linalg.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616

1717
#include "common.hpp"
1818

19-
#ifdef DPNP_ENABLE
19+
#ifdef IMEX_USE_DPNP
2020
#include <dpnp_iface.hpp>
2121
#endif
2222

2323
namespace {
2424
template <typename T>
2525
void eigImpl(Memref<2, const T> *input, Memref<1, T> *vals,
2626
Memref<2, T> *vecs) {
27-
#ifdef DPNP_ENABLE
27+
#ifdef IMEX_USE_DPNP
2828
dpnp_eig_c<T, T>(input->data, vals->data, vecs->data, input->dims[0]);
2929
#else
3030
(void)input;

numba_dpcomp/numba_dpcomp/mlir_compiler/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE
101101
PRIVATE
102102
./lib)
103103

104-
if(DPNP_ENABLE)
105-
target_compile_definitions(${PROJECT_NAME} PRIVATE DPNP_ENABLE=1)
104+
if(IMEX_USE_DPNP)
105+
target_compile_definitions(${PROJECT_NAME} PRIVATE IMEX_USE_DPNP=1)
106106
endif()
107107

108-
if(GPU_ENABLE)
109-
target_compile_definitions(${PROJECT_NAME} PRIVATE GPU_ENABLE=1)
108+
if(IMEX_ENABLE_IGPU_DIALECT)
109+
target_compile_definitions(${PROJECT_NAME} PRIVATE IMEX_ENABLE_IGPU_DIALECT=1)
110110
endif()
111111

112112
set(CMAKE_INSTALL_BINDIR ./numba_dpcomp/numba_dpcomp)
@@ -117,7 +117,7 @@ install(TARGETS dpcomp-runtime dpcomp-math-runtime dpcomp-python-runtime mlir_co
117117
LIBRARY DESTINATION numba_dpcomp/numba_dpcomp
118118
)
119119

120-
if(GPU_ENABLE)
120+
if(IMEX_ENABLE_IGPU_DIALECT)
121121
install(TARGETS dpcomp-gpu-runtime
122122
LIBRARY DESTINATION numba_dpcomp/numba_dpcomp
123123
)

numba_dpcomp/numba_dpcomp/mlir_compiler/lib/lowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ static void createPipeline(plier::PipelineRegistry &registry,
711711
registerParallelToTBBPipeline(registry);
712712

713713
if (settings.enableGpuPipeline) {
714-
#ifdef GPU_ENABLE
714+
#ifdef IMEX_ENABLE_IGPU_DIALECT
715715
registerLowerToGPUPipeline(registry);
716716
// TODO(nbpatel): Add Gpu->GpuRuntime & GpuRuntimetoLlvm Transformation
717717
#else

numba_dpcomp/numba_dpcomp/mlir_compiler/lib/py_module.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
namespace {
2222
bool is_dpnp_supported() {
23-
#ifdef DPNP_ENABLE
23+
#ifdef IMEX_USE_DPNP
2424
return true;
2525
#else
2626
return false;

numba_dpcomp/setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
"-DCMAKE_INSTALL_PREFIX=" + CMAKE_INSTALL_PREFIX,
6464
"-DPython3_NumPy_INCLUDE_DIRS=" + NUMPY_INCLUDE_DIR,
6565
"-DPython3_FIND_STRATEGY=LOCATION",
66-
"-DNUMBA_ENABLE=ON",
67-
"-DTBB_ENABLE=ON",
66+
"-DIMEX_ENABLE_NUMBA_FE=ON",
67+
"-DIMEX_ENABLE_TBB_SUPPORT=ON",
6868
]
6969

7070
# DPNP
@@ -76,7 +76,7 @@
7676
cmake_cmd += [
7777
"-DDPNP_LIBRARY_DIR=" + DPNP_LIBRARY_DIR,
7878
"-DDPNP_INCLUDE_DIR=" + DPNP_INCLUDE_DIR,
79-
"-DDPNP_ENABLE=ON",
79+
"-DIMEX_USE_DPNP=ON",
8080
]
8181
print("Found DPNP at", DPNP_LIBRARY_DIR)
8282
except ImportError:
@@ -89,7 +89,7 @@
8989
else:
9090
print("LEVEL_ZERO_DIR is", LEVEL_ZERO_DIR)
9191
cmake_cmd += [
92-
"-DGPU_ENABLE=ON",
92+
"-DIMEX_ENABLE_IGPU_DIALECT=ON",
9393
]
9494

9595
try:

0 commit comments

Comments
 (0)