Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04]
std: [20, 17]


runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -57,5 +59,5 @@ jobs:

- name: Build MUDA
run: |
cmake --preset ci-release
cmake --build --preset ci-release --parallel 4
cmake --preset ci-release-${{ matrix.std }}
cmake --build --preset ci-release-${{ matrix.std }} --parallel 4
38 changes: 30 additions & 8 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,54 @@
"MUDA_FORCE_CHECK": "ON",
"MUDA_WITH_CHECK": "ON",
"MUDA_WITH_COMPUTE_GRAPH": "ON",
"MUDA_WITH_NVTX3": "ON"
"MUDA_WITH_NVTX3": "OFF"
}
},
{
"name": "ci-release",
"displayName": "CI-Release Configuration",
"name": "ci-release-20",
"displayName": "CI-Release Configuration (C++20)",
"inherits": ["config-base"],
"description": "Configuration for CI builds",
"cacheVariables": {
"MUDA_BUILD_TEST": "ON",
"MUDA_BUILD_EXAMPLE": "OFF",
"CMAKE_CUDA_ARCHITECTURES": "89",
"CMAKE_BUILD_TYPE": "Release"
"CMAKE_BUILD_TYPE": "Release",
"MUDA_APP_CXX_STANDARD": "20"
}
},
{
"name": "ci-release-17",
"displayName": "CI-Release Configuration (C++17)",
"inherits": ["config-base"],
"description": "Configuration for CI builds",
"cacheVariables": {
"MUDA_BUILD_TEST": "ON",
"MUDA_BUILD_EXAMPLE": "OFF",
"CMAKE_CUDA_ARCHITECTURES": "89",
"CMAKE_BUILD_TYPE": "Release",
"MUDA_APP_CXX_STANDARD": "17"
}
}
],
"buildPresets": [
{
"name": "ci-release",
"configurePreset": "ci-release"
"name": "ci-release-20",
"configurePreset": "ci-release-20"
},
{
"name": "ci-release-17",
"configurePreset": "ci-release-17"
}
],
"testPresets": [
{
"name": "ci-release",
"configurePreset": "ci-release"
"name": "ci-release-20",
"configurePreset": "ci-release-20"
},
{
"name": "ci-release-17",
"configurePreset": "ci-release-17"
}
]
}
1 change: 1 addition & 0 deletions cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ option(MUDA_WITH_NVTX3 "turn on nividia tools extension library" OFF)
# build targets:
option(MUDA_BUILD_EXAMPLE "build muda examples. if you want to see how to use muda, you could enable this option." ON)
option(MUDA_BUILD_TEST "build muda test. if you're the developer, you could enable this option." OFF)
option(MUDA_APP_CXX_STANDARD "set c++ standard for muda app(test/example)" 20)

# short cut
option(MUDA_DEV "build muda example and unit test. if you're the developer, you could enable this option." OFF)
Expand Down
2 changes: 1 addition & 1 deletion example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ file(GLOB_RECURSE SOURCE_FILES

add_executable(muda_example)
target_sources(muda_example PRIVATE ${SOURCE_FILES} ${MUDA_HEADER_FILES})
target_compile_features(muda_example PRIVATE cxx_std_20)
target_compile_features(muda_example PRIVATE "cxx_std_${MUDA_APP_CXX_STANDARD}")
set_target_properties(muda_example PROPERTIES CUDA_SEPARABLE_COMPILATION ON)

# target_link_libraries(muda_example PRIVATE fmt::fmt-header-only)
Expand Down
10 changes: 6 additions & 4 deletions src/muda/buffer/details/buffer_2d_view.inl
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,12 @@ template <bool IsConst, typename T>
MUDA_GENERIC cudaPitchedPtr Buffer2DViewT<IsConst, T>::cuda_pitched_ptr() const MUDA_NOEXCEPT
{
// don't use make_cudaPitchedPtr (__host__ only function)
return cudaPitchedPtr{.ptr = remove_const(m_data),
.pitch = remove_const(m_pitch_bytes),
.xsize = m_origin_width * sizeof(T),
.ysize = m_origin_height};
cudaPitchedPtr R;
R.ptr = remove_const(m_data);
R.pitch = remove_const(m_pitch_bytes);
R.xsize = m_origin_width * sizeof(T);
R.ysize = m_origin_height;
return R;
}

template <bool IsConst, typename T>
Expand Down
10 changes: 6 additions & 4 deletions src/muda/buffer/details/buffer_3d_view.inl
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ MUDA_GENERIC auto Buffer3DViewT<IsConst, T>::cuda_pitched_ptr() const MUDA_NOEXC
-> cudaPitchedPtr
{
// don't use make_cudaPitchedPtr (__host__ only function)
return cudaPitchedPtr{.ptr = remove_const(m_data),
.pitch = remove_const(m_pitch_bytes),
.xsize = m_origin_width * sizeof(T),
.ysize = m_origin_height};
cudaPitchedPtr R;
R.ptr = remove_const(m_data);
R.pitch = remove_const(m_pitch_bytes);
R.xsize = m_origin_width * sizeof(T);
R.ysize = m_origin_height;
return R;
}

template <bool IsConst, typename T>
Expand Down
4 changes: 2 additions & 2 deletions src/muda/ext/linear_system/details/device_dense_matrix.inl
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ DeviceDenseMatrix<Ty>& DeviceDenseMatrix<Ty>::operator=(const Eigen::MatrixX<Ty>
template <typename Ty>
DenseMatrixView<Ty> DeviceDenseMatrix<Ty>::T()
{
return DenseMatrixView{m_data, m_row, m_col, true, m_sym};
return DenseMatrixView<Ty>{m_data, m_row, m_col, true, m_sym};
}

template <typename Ty>
CDenseMatrixView<Ty> DeviceDenseMatrix<Ty>::T() const
{
return CDenseMatrixView{m_data, m_row, m_col, true, m_sym};
return CDenseMatrixView<Ty>{m_data, m_row, m_col, true, m_sym};
}

template <typename Ty>
Expand Down
2 changes: 1 addition & 1 deletion test/eigen_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ find_package(Eigen3 REQUIRED)
file(GLOB_RECURSE SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/*.cu" "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
add_executable(muda_eigen_test)
target_sources(muda_eigen_test PRIVATE ${SOURCE} ${MUDA_HEADER_FILES})
target_compile_features(muda_eigen_test PRIVATE cxx_std_20)
target_compile_features(muda_eigen_test PRIVATE "cxx_std_${MUDA_APP_CXX_STANDARD}")
set_target_properties(muda_eigen_test PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
target_include_directories(muda_eigen_test PRIVATE
"${PROJECT_SOURCE_DIR}/test"
Expand Down
2 changes: 1 addition & 1 deletion test/linear_system_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ file(GLOB_RECURSE SOURCE
"${CMAKE_CURRENT_SOURCE_DIR}/*.h")
add_executable(muda_linear_system_test)
target_sources(muda_linear_system_test PRIVATE ${SOURCE} ${MUDA_HEADER_FILES})
target_compile_features(muda_linear_system_test PRIVATE cxx_std_20)
target_compile_features(muda_linear_system_test PRIVATE "cxx_std_${MUDA_APP_CXX_STANDARD}")
set_target_properties(muda_linear_system_test PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
target_include_directories(muda_linear_system_test PRIVATE
"${PROJECT_SOURCE_DIR}/test"
Expand Down
2 changes: 1 addition & 1 deletion test/spgrid_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ file(GLOB_RECURSE SOURCE

add_executable(muda_spgrid_test)
target_sources(muda_spgrid_test PRIVATE ${SOURCE} ${MUDA_HEADER_FILES})
target_compile_features(muda_spgrid_test PRIVATE cxx_std_20)
target_compile_features(muda_spgrid_test PRIVATE "cxx_std_${MUDA_APP_CXX_STANDARD}")
set_target_properties(muda_spgrid_test PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
target_include_directories(muda_spgrid_test PRIVATE
"${PROJECT_SOURCE_DIR}/test"
Expand Down
2 changes: 1 addition & 1 deletion test/unit_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ file(GLOB_RECURSE SOURCE
"${CMAKE_CURRENT_SOURCE_DIR}/*.h")
add_executable(muda_unit_test)
target_sources(muda_unit_test PRIVATE ${SOURCE} ${MUDA_HEADER_FILES})
target_compile_features(muda_unit_test PRIVATE cxx_std_20)
target_compile_features(muda_unit_test PRIVATE "cxx_std_${MUDA_APP_CXX_STANDARD}")
set_target_properties(muda_unit_test PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
target_include_directories(muda_unit_test PRIVATE
"${PROJECT_SOURCE_DIR}/test"
Expand Down
Loading