Skip to content

Commit

Permalink
Actions (#427)
Browse files Browse the repository at this point in the history
* organizing actions

* not building json tests for clang on windows

* trying to get linux to run

* debug and release types on mac and unbuntu

* readme badges and docker and coverage test name

* adding gcc and clang tests for debug and release on mac

* adding concurrency check

* trying to prevent duplicates from running

* another duplicate prevention

* removing x86 because it takes too long

* using homebrew gcc compilers

* remove large files to allow intel dockerfile to run

* removing comment

* fixing build

* making tests pass for intel buil

* maybe now

* not running tests on nvhpc build

* syntax fix

* trying to make github pickup the actions changes

* removing comment

* maybe being more correct in the windows action?

* Revert "making tests pass for intel buil"

This reverts commit 8f7d493.

* Revert "maybe now"

This reverts commit 443ab5f.

* setting intel compiler flags
  • Loading branch information
K20shores authored Mar 14, 2024
1 parent 0c23465 commit 5a4bf3f
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 27 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/docker_and_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,23 @@ jobs:
- Dockerfile.no_json
- Dockerfile.nvhpc
- Dockerfile.openmp
# - Dockerfile.intel # intel image is too large for GH action
- Dockerfile.intel
# - Dockerfile.mpi
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive

- name: Delete huge unnecessary tools folder
run: rm -rf /opt/hostedtoolcache

- name: Build Docker image
run: docker build -t micm -f docker/${{ matrix.dockerfile }} .

- name: Run tests in container
if: matrix.dockerfile != 'Dockerfile.coverage'
# only run this if we are not running coverage tests or have built the cuda files
if: matrix.dockerfile != 'Dockerfile.coverage' && matrix.dockerfile != 'Dockerfile.nvhpc'
run: docker run --name test-container -t micm bash -c 'make test ARGS="--rerun-failed --output-on-failure -j8"'

- name: Run coverage tests in container
Expand Down
13 changes: 2 additions & 11 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,7 @@ jobs:
- uses: actions/checkout@v3

- name: Run CMake
run: cmake -S . -B build -G "Visual Studio 16 2019" -A ${{ matrix.architecture }}
if: matrix.build_type == 'Release'

- name: Run CMake
run: cmake -S . -B build -G "Visual Studio 16 2019" -A ${{ matrix.architecture }}
if: matrix.build_type == 'Debug'
run: cmake -S . -B build -G "Visual Studio 16 2019" -A ${{ matrix.architecture }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}

- name: Build
run: cmake --build build --config ${{ matrix.build_type }} --parallel 10
Expand Down Expand Up @@ -82,11 +77,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Run CMake
run: cmake -S . -B build -G "Visual Studio 17 2022" -A ${{ matrix.architecture }}
if: matrix.build_type == 'Release'
- name: Run CMake
run: cmake -S . -B build -G "Visual Studio 17 2022" -A ${{ matrix.architecture }}
if: matrix.build_type == 'Debug'
run: cmake -S . -B build -G "Visual Studio 17 2022" -A ${{ matrix.architecture }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
- name: Build
run: cmake --build build --config ${{ matrix.build_type }} --parallel 10
- name: Test
Expand Down
1 change: 0 additions & 1 deletion docker/Dockerfile.intel
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ RUN mkdir /build \
&& cd /build \
&& cmake \
-D CMAKE_BUILD_TYPE=release \
# -D CMAKE_CXX_FLAGS_DEBUG="-g -Rno-debug-disables-optimization" \
../micm \
&& make -j 8 install

Expand Down
15 changes: 3 additions & 12 deletions docker/Dockerfile.nvhpc
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,17 @@ ENV FC=nvfortran
# Micm
COPY . /micm/

# build the library and run the tests
RUN mkdir /build \
&& cd /build \
&& cmake \
-D CMAKE_BUILD_TYPE=release \
../micm \
&& make -j 8 install


# copy headers needed for cublas to /usr/include
RUN cp -r /opt/nvidia/hpc_sdk/*/23.7/cuda/include/* /usr/include/

# build the library and run the tests
RUN mkdir /cuda_build \
&& cd /cuda_build \
RUN mkdir /build \
&& cd /build \
&& cmake \
-D CMAKE_BUILD_TYPE=debug \
-D MICM_ENABLE_CUDA=ON \
-D MICM_GPU_TYPE="a100" \
../micm \
&& make -j 8 install
&& make

WORKDIR /build
13 changes: 13 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ target_include_directories(micm
$<INSTALL_INTERFACE:include>
)

# Check for Intel compiler
if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" OR CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
# Set compiler flags for Intel C++
if (WIN32)
# For Windows
target_compile_options(micm INTERFACE "/fp:precise")
else ()
# For other operating systems (e.g., Linux, macOS)
target_compile_options(micm INTERFACE "-ffp-model=precise")
endif ()
endif ()


if(MICM_ENABLE_JSON)
target_link_libraries(micm INTERFACE nlohmann_json::nlohmann_json)
target_compile_definitions(micm INTERFACE USE_JSON)
Expand Down
2 changes: 1 addition & 1 deletion test/unit/util/test_cuda_vector_matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ TEST(CudaVectorMatrix, DeviceMemCopy)
EXPECT_EQ(h_vector[3], 4 * 4);
}

template<class T, std::size_t L = DEFAULT_VECTOR_SIZE>
template<class T, std::size_t L = MICM_DEFAULT_VECTOR_SIZE>
static void ModifyAndSyncToHost(micm::CudaVectorMatrix<T, L>& matrix)
{
matrix.CopyToDevice();
Expand Down

0 comments on commit 5a4bf3f

Please sign in to comment.