From 9ef48b585bf73e81340fc2e5cdddfefdbdcf4436 Mon Sep 17 00:00:00 2001 From: "Chong, Kwitae" Date: Mon, 5 Feb 2024 10:27:52 -0500 Subject: [PATCH 1/6] update kokkos min to 4.1 --- .github/workflows/CI.yml | 46 ++++++++++++++++++++-------------------- CMakeLists.txt | 2 +- docker/Dockerfile | 2 +- docker/Dockerfile.hipcc | 2 +- docker/Dockerfile.sycl | 2 +- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8b92a73f3..574b64363 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -27,7 +27,7 @@ jobs: cxx: ['g++', 'clang++'] backend: ['OPENMP', 'SERIAL'] cmake_build_type: ['Debug', 'Release'] - kokkos_ver: ['3.7.02'] + kokkos_ver: ['4.1.00'] bounds_check: ['OFF'] arborx: ['OFF'] heffte: ['OFF' ] @@ -42,7 +42,7 @@ jobs: cxx: 'g++' backend: 'THREADS' cmake_build_type: 'Debug' - kokkos_ver: '3.7.02' + kokkos_ver: '4.1.00' arborx: 'OFF' heffte: 'OFF' hypre: 'OFF' @@ -52,7 +52,7 @@ jobs: cxx: 'icpx' backend: 'OPENMP' cmake_build_type: 'Release' - kokkos_ver: '3.7.02' + kokkos_ver: '4.1.00' arborx: 'OFF' heffte: 'OFF' hypre: 'OFF' @@ -61,7 +61,7 @@ jobs: cxx: 'icpx' backend: 'OPENMP' cmake_build_type: 'Debug' - kokkos_ver: '3.7.02' + kokkos_ver: '4.1.00' arborx: 'OFF' heffte: 'OFF' hypre: 'OFF' @@ -70,7 +70,7 @@ jobs: cxx: 'icpx' backend: 'SERIAL' cmake_build_type: 'Release' - kokkos_ver: '3.7.02' + kokkos_ver: '4.1.00' arborx: 'OFF' heffte: 'OFF' hypre: 'OFF' @@ -79,7 +79,7 @@ jobs: cxx: 'icpx' backend: 'SERIAL' cmake_build_type: 'Debug' - kokkos_ver: '3.7.02' + kokkos_ver: '4.1.00' arborx: 'OFF' heffte: 'OFF' hypre: 'OFF' @@ -88,7 +88,7 @@ jobs: cxx: 'icpx' backend: 'SERIAL' cmake_build_type: 'Debug' - kokkos_ver: '3.7.02' + kokkos_ver: '4.1.00' arborx: 'OFF' heffte: 'MKL' hypre: 'OFF' @@ -98,7 +98,7 @@ jobs: cxx: 'g++' backend: 'OPENMP' cmake_build_type: 'Release' - kokkos_ver: '4.0.00' + kokkos_ver: '4.1.00' arborx: 'OFF' heffte: 'OFF' hypre: 'OFF' @@ -109,7 +109,7 @@ jobs: cxx: 'clang++' backend: 'OPENMP' cmake_build_type: 'Release' - kokkos_ver: '4.0.00' + kokkos_ver: '4.1.00' arborx: 'OFF' heffte: 'OFF' hypre: 'OFF' @@ -118,7 +118,7 @@ jobs: cxx: 'g++' cmake_build_type: 'Release' backend: 'OPENMP' - kokkos_ver: '4.0.00' + kokkos_ver: '4.1.00' arborx: 'OFF' heffte: 'OFF' hypre: 'OFF' @@ -127,7 +127,7 @@ jobs: cxx: 'clang++' backend: 'OPENMP' cmake_build_type: 'Release' - kokkos_ver: '4.0.00' + kokkos_ver: '4.1.00' arborx: 'OFF' heffte: 'OFF' hypre: 'OFF' @@ -137,7 +137,7 @@ jobs: cxx: 'g++' cmake_build_type: 'Release' backend: 'OPENMP' - kokkos_ver: '3.7.02' + kokkos_ver: '4.1.00' arborx: 'OFF' heffte: 'OFF' hypre: 'OFF' @@ -146,7 +146,7 @@ jobs: cxx: 'clang++' backend: 'OPENMP' cmake_build_type: 'Release' - kokkos_ver: '3.7.02' + kokkos_ver: '4.1.00' arborx: 'OFF' heffte: 'OFF' hypre: 'OFF' @@ -155,7 +155,7 @@ jobs: cxx: 'g++' backend: 'OPENMP' cmake_build_type: 'Debug' - kokkos_ver: '4.0.00' + kokkos_ver: '4.1.00' arborx: 'ArborX' heffte: 'OFF' hypre: 'OFF' @@ -164,7 +164,7 @@ jobs: cxx: 'g++' backend: 'OPENMP' cmake_build_type: 'Release' - kokkos_ver: '3.7.02' + kokkos_ver: '4.1.00' arborx: 'ArborX' heffte: 'OFF' hypre: 'OFF' @@ -173,7 +173,7 @@ jobs: cxx: 'g++' backend: 'OPENMP' cmake_build_type: 'Release' - kokkos_ver: '3.7.02' + kokkos_ver: '4.1.00' arborx: 'OFF' heffte: 'FFTW' hypre: 'OFF' @@ -182,7 +182,7 @@ jobs: cxx: 'g++' backend: 'OPENMP' cmake_build_type: 'Release' - kokkos_ver: '3.7.02' + kokkos_ver: '4.1.00' arborx: 'OFF' heffte: 'OFF' hypre: 'OFF' @@ -192,7 +192,7 @@ jobs: cxx: 'g++' backend: 'OPENMP' cmake_build_type: 'Debug' - kokkos_ver: '3.7.02' + kokkos_ver: '4.1.00' arborx: 'OFF' heffte: 'OFF' hypre: 'HYPRE' @@ -201,7 +201,7 @@ jobs: cxx: 'g++' backend: 'OPENMP' cmake_build_type: 'Debug' - kokkos_ver: '3.7.02' + kokkos_ver: '4.1.00' arborx: 'OFF' heffte: 'OFF' hypre: 'OFF' @@ -211,7 +211,7 @@ jobs: cxx: 'g++' backend: 'OPENMP' cmake_build_type: 'Debug' - kokkos_ver: '3.7.02' + kokkos_ver: '4.1.00' arborx: 'OFF' heffte: 'OFF' hypre: 'OFF' @@ -221,7 +221,7 @@ jobs: cxx: 'g++' backend: 'OPENMP' cmake_build_type: 'Debug' - kokkos_ver: '3.7.02' + kokkos_ver: '4.1.00' arborx: 'ArborX' heffte: 'FFTW' hypre: 'HYPRE' @@ -234,7 +234,7 @@ jobs: cxx: 'g++' backend: 'OPENMP' cmake_build_type: 'Debug' - kokkos_ver: '3.7.02' + kokkos_ver: '4.1.00' arborx: 'ArborX' heffte: 'FFTW' hypre: 'HYPRE' @@ -568,7 +568,7 @@ jobs: matrix: cxx: ['nvcc'] cmake_build_type: ['Release'] - kokkos_ver: ['3.7.02'] + kokkos_ver: ['4.1.00'] runs-on: ubuntu-20.04 container: ghcr.io/ecp-copa/ci-containers/cuda:12.2.0 steps: diff --git a/CMakeLists.txt b/CMakeLists.txt index 2bcb96007..c228d50a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,7 +36,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # Dependencies #------------------------------------------------------------------------------# # find kokkos -find_package(Kokkos 3.7 REQUIRED) +find_package(Kokkos 4.1 REQUIRED) # set supported kokkos devices set(CABANA_SUPPORTED_DEVICES SERIAL THREADS OPENMP CUDA HIP SYCL OPENMPTARGET) diff --git a/docker/Dockerfile b/docker/Dockerfile index dc18f4c3a..31d368172 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -61,7 +61,7 @@ RUN OPENMPI_VERSION=4.0.2 && \ ENV PATH=${OPENMPI_DIR}/bin:$PATH # Install Kokkos -ARG KOKKOS_VERSION=3.7.02 +ARG KOKKOS_VERSION=4.1.00 ENV KOKKOS_DIR=/opt/kokkos RUN KOKKOS_URL=https://github.com/kokkos/kokkos/archive/${KOKKOS_VERSION}.tar.gz && \ KOKKOS_ARCHIVE=kokkos-${KOKKOS_VERSION}.tar.gz && \ diff --git a/docker/Dockerfile.hipcc b/docker/Dockerfile.hipcc index 9a69e5505..ea2af0ec5 100644 --- a/docker/Dockerfile.hipcc +++ b/docker/Dockerfile.hipcc @@ -71,7 +71,7 @@ RUN OPENMPI_VERSION=4.0.4 && \ ENV PATH=${OPENMPI_DIR}/bin:$PATH # Install Kokkos -ARG KOKKOS_VERSION=3.7.02 +ARG KOKKOS_VERSION=4.1.00 ARG KOKKOS_OPTIONS="-DKokkos_ENABLE_HIP=ON -DKokkos_ENABLE_LIBDL=OFF -DKokkos_ARCH_VEGA906=ON" ENV KOKKOS_DIR=/opt/kokkos RUN KOKKOS_URL=https://github.com/kokkos/kokkos/archive/${KOKKOS_VERSION}.tar.gz && \ diff --git a/docker/Dockerfile.sycl b/docker/Dockerfile.sycl index 5f125707f..3ca5fafe1 100644 --- a/docker/Dockerfile.sycl +++ b/docker/Dockerfile.sycl @@ -65,7 +65,7 @@ RUN wget https://cloud.cees.ornl.gov/download/oneapi-for-nvidia-gpus-${DPCPP_VER rm oneapi-for-nvidia-gpus-${DPCPP_VERSION}-linux.sh # Install Kokkos -ARG KOKKOS_VERSION=3.7.02 +ARG KOKKOS_VERSION=4.1.00 ARG KOKKOS_OPTIONS="-DKokkos_ENABLE_SYCL=ON -DCMAKE_CXX_FLAGS=-Wno-unknown-cuda-version -DKokkos_ENABLE_UNSUPPORTED_ARCHS=ON -DKokkos_ARCH_VOLTA70=ON -DCMAKE_CXX_STANDARD=17" ENV KOKKOS_DIR=/opt/kokkos RUN . /opt/intel/oneapi/setvars.sh --include-intel-llvm && \ From 83eb5582034fed4424a383c109f21a5127123280 Mon Sep 17 00:00:00 2001 From: Sam Reeve <6740307+streeve@users.noreply.github.com> Date: Fri, 9 Feb 2024 10:53:18 -0500 Subject: [PATCH 2/6] fixup: bump HIP CI to rocm 5.2 for Kokkos 4.1 --- .jenkins | 4 ++-- docker/Dockerfile.hipcc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.jenkins b/.jenkins index c658ff8b1..b76b5d08d 100644 --- a/.jenkins +++ b/.jenkins @@ -56,12 +56,12 @@ pipeline { } } } - stage('ROCM-4.5-HIPCC-DEBUG') { + stage('ROCM-5.2-HIPCC-DEBUG') { agent { dockerfile { filename 'Dockerfile.hipcc' dir 'docker' - additionalBuildArgs '--build-arg BASE=rocm/dev-ubuntu-20.04:4.5-complete' + additionalBuildArgs '--build-arg BASE=rocm/dev-ubuntu-20.04:5.2-complete' args '-v /tmp/ccache.kokkos:/tmp/ccache --device=/dev/kfd --device=/dev/dri --security-opt seccomp=unconfined --group-add video --env HIP_VISIBLE_DEVICES=$HIP_VISIBLE_DEVICES' label 'rocm-docker && vega && AMD_Radeon_Instinct_MI60' } diff --git a/docker/Dockerfile.hipcc b/docker/Dockerfile.hipcc index ea2af0ec5..7c63d9d82 100644 --- a/docker/Dockerfile.hipcc +++ b/docker/Dockerfile.hipcc @@ -1,5 +1,5 @@ # Use -complete to get both rocm and rocfft -ARG BASE=rocm/dev-ubuntu-20.04:4.5-complete +ARG BASE=rocm/dev-ubuntu-20.04:5.2-complete FROM $BASE ARG NPROCS=4 From 09f172aedb5d325cdd33dfb8fbe65a01fc6078d2 Mon Sep 17 00:00:00 2001 From: Sam Reeve <6740307+streeve@users.noreply.github.com> Date: Fri, 9 Feb 2024 11:57:07 -0500 Subject: [PATCH 3/6] fixup: remove outdated Kokkos math namespace in test --- grid/unit_test/tstBovWriter.hpp | 60 ++++++++++++++++----------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/grid/unit_test/tstBovWriter.hpp b/grid/unit_test/tstBovWriter.hpp index 3dd73da29..8eaccd059 100644 --- a/grid/unit_test/tstBovWriter.hpp +++ b/grid/unit_test/tstBovWriter.hpp @@ -71,12 +71,6 @@ void writeTest3d() createArray( "cell_field_3d", cell_layout ); auto cell_data = cell_field->view(); - // FIXME_SYCL (remove ifdef when newest Kokkos is required) -#if ( defined __SYCL_DEVICE_ONLY__ ) - using Kokkos::Experimental::cos; - using Kokkos::Experimental::fabs; -#endif - Kokkos::parallel_for( "fill_cell_field", createExecutionPolicy( @@ -87,8 +81,9 @@ void writeTest3d() double yarg = double( off_j + j ) / num_cell_dev[1]; double zarg = double( off_k + k ) / num_cell_dev[2]; cell_data( i, j, k, 0 ) = - 1.0 + fabs( cos( pi2 * xarg ) * cos( pi2 * yarg ) * - cos( pi2 * zarg ) ); + 1.0 + fabs( Kokkos::cos( pi2 * xarg ) * + Kokkos::cos( pi2 * yarg ) * + Kokkos::cos( pi2 * zarg ) ); } ); // Create a vector node field and fill it with data. @@ -105,9 +100,12 @@ void writeTest3d() double xarg = double( off_i + i ) / num_cell_dev[0]; double yarg = double( off_j + j ) / num_cell_dev[1]; double zarg = double( off_k + k ) / num_cell_dev[2]; - node_data( i, j, k, Dim::I ) = 1.0 + fabs( cos( pi2 * xarg ) ); - node_data( i, j, k, Dim::J ) = 1.0 + fabs( cos( pi2 * yarg ) ); - node_data( i, j, k, Dim::K ) = 1.0 + fabs( cos( pi2 * zarg ) ); + node_data( i, j, k, Dim::I ) = + 1.0 + fabs( Kokkos::cos( pi2 * xarg ) ); + node_data( i, j, k, Dim::J ) = + 1.0 + fabs( Kokkos::cos( pi2 * yarg ) ); + node_data( i, j, k, Dim::K ) = + 1.0 + fabs( Kokkos::cos( pi2 * zarg ) ); } ); // Gather the node data. @@ -145,10 +143,10 @@ void writeTest3d() cell_data_file.seekg( cell_id * sizeof( double ) ); cell_data_file.read( (char*)&cell_value, sizeof( double ) ); - EXPECT_FLOAT_EQ( - cell_value, - 1.0 + fabs( cos( pi2 * xarg ) * cos( pi2 * yarg ) * - cos( pi2 * zarg ) ) ); + EXPECT_FLOAT_EQ( cell_value, + 1.0 + fabs( Kokkos::cos( pi2 * xarg ) * + Kokkos::cos( pi2 * yarg ) * + Kokkos::cos( pi2 * zarg ) ) ); ++cell_id; } @@ -178,19 +176,19 @@ void writeTest3d() node_data_file.seekg( node_id * sizeof( double ) ); node_data_file.read( (char*)&node_value, sizeof( double ) ); EXPECT_FLOAT_EQ( node_value, - 1.0 + fabs( cos( pi2 * xarg ) ) ); + 1.0 + fabs( Kokkos::cos( pi2 * xarg ) ) ); ++node_id; node_data_file.seekg( node_id * sizeof( double ) ); node_data_file.read( (char*)&node_value, sizeof( double ) ); EXPECT_FLOAT_EQ( node_value, - 1.0 + fabs( cos( pi2 * yarg ) ) ); + 1.0 + fabs( Kokkos::cos( pi2 * yarg ) ) ); ++node_id; node_data_file.seekg( node_id * sizeof( double ) ); node_data_file.read( (char*)&node_value, sizeof( double ) ); EXPECT_FLOAT_EQ( node_value, - 1.0 + fabs( cos( pi2 * zarg ) ) ); + 1.0 + fabs( Kokkos::cos( pi2 * zarg ) ) ); ++node_id; } @@ -236,11 +234,6 @@ void writeTest2d() createArray( "cell_field_2d", cell_layout ); auto cell_data = cell_field->view(); - // FIXME_SYCL (remove ifdef when newest Kokkos is required) -#if ( defined __SYCL_DEVICE_ONLY__ ) - using Kokkos::Experimental::cos; - using Kokkos::Experimental::fabs; -#endif Kokkos::parallel_for( "fill_cell_field", createExecutionPolicy( @@ -249,8 +242,8 @@ void writeTest2d() KOKKOS_LAMBDA( const int i, const int j ) { double xarg = double( off_i + i ) / num_cell_dev[0]; double yarg = double( off_j + j ) / num_cell_dev[1]; - cell_data( i, j, 0 ) = - 1.0 + fabs( cos( pi2 * xarg ) * cos( pi2 * yarg ) ); + cell_data( i, j, 0 ) = 1.0 + fabs( Kokkos::cos( pi2 * xarg ) * + Kokkos::cos( pi2 * yarg ) ); } ); // Create a vector node field and fill it with data. @@ -266,8 +259,10 @@ void writeTest2d() KOKKOS_LAMBDA( const int i, const int j ) { double xarg = double( off_i + i ) / num_cell_dev[0]; double yarg = double( off_j + j ) / num_cell_dev[1]; - node_data( i, j, Dim::I ) = 1.0 + fabs( cos( pi2 * xarg ) ); - node_data( i, j, Dim::J ) = 1.0 + fabs( cos( pi2 * yarg ) ); + node_data( i, j, Dim::I ) = + 1.0 + fabs( Kokkos::cos( pi2 * xarg ) ); + node_data( i, j, Dim::J ) = + 1.0 + fabs( Kokkos::cos( pi2 * yarg ) ); } ); // Gather the node data. @@ -302,8 +297,9 @@ void writeTest2d() cell_data_file.seekg( cell_id * sizeof( double ) ); cell_data_file.read( (char*)&cell_value, sizeof( double ) ); - EXPECT_FLOAT_EQ( cell_value, 1.0 + fabs( cos( pi2 * xarg ) * - cos( pi2 * yarg ) ) ); + EXPECT_FLOAT_EQ( cell_value, + 1.0 + fabs( Kokkos::cos( pi2 * xarg ) * + Kokkos::cos( pi2 * yarg ) ) ); ++cell_id; } @@ -328,12 +324,14 @@ void writeTest2d() node_data_file.seekg( node_id * sizeof( double ) ); node_data_file.read( (char*)&node_value, sizeof( double ) ); - EXPECT_FLOAT_EQ( node_value, 1.0 + fabs( cos( pi2 * xarg ) ) ); + EXPECT_FLOAT_EQ( node_value, + 1.0 + fabs( Kokkos::cos( pi2 * xarg ) ) ); ++node_id; node_data_file.seekg( node_id * sizeof( double ) ); node_data_file.read( (char*)&node_value, sizeof( double ) ); - EXPECT_FLOAT_EQ( node_value, 1.0 + fabs( cos( pi2 * yarg ) ) ); + EXPECT_FLOAT_EQ( node_value, + 1.0 + fabs( Kokkos::cos( pi2 * yarg ) ) ); ++node_id; } From b751e06cb679cc6d9222cb39ca9fdb3aca4981e7 Mon Sep 17 00:00:00 2001 From: Sam Reeve <6740307+streeve@users.noreply.github.com> Date: Fri, 9 Feb 2024 11:58:29 -0500 Subject: [PATCH 4/6] fixup: use recent ArborX release in jenkins CI --- docker/Dockerfile | 2 +- docker/Dockerfile.hipcc | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 31d368172..596a00041 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -84,7 +84,7 @@ RUN KOKKOS_URL=https://github.com/kokkos/kokkos/archive/${KOKKOS_VERSION}.tar.gz # Install ArborX ENV ARBORX_DIR=/opt/arborx -RUN ARBORX_VERSION=4834bff44c23c9510c6ed93366638dcdf85ab217 && \ +RUN ARBORX_VERSION=v1.4 && \ ARBORX_URL=https://github.com/arborx/ArborX/archive/${ARBORX_VERSION}.tar.gz && \ ARBORX_ARCHIVE=arborx.tar.gz && \ wget --quiet ${ARBORX_URL} --output-document=${ARBORX_ARCHIVE} && \ diff --git a/docker/Dockerfile.hipcc b/docker/Dockerfile.hipcc index 7c63d9d82..16cf618d9 100644 --- a/docker/Dockerfile.hipcc +++ b/docker/Dockerfile.hipcc @@ -88,7 +88,7 @@ RUN KOKKOS_URL=https://github.com/kokkos/kokkos/archive/${KOKKOS_VERSION}.tar.gz # Install ArborX ENV ARBORX_DIR=/opt/arborx -RUN ARBORX_VERSION=4834bff44c23c9510c6ed93366638dcdf85ab217 && \ +RUN ARBORX_VERSION=v1.4 && \ ARBORX_URL=https://github.com/arborx/ArborX/archive/${ARBORX_VERSION}.tar.gz && \ ARBORX_ARCHIVE=arborx.tar.gz && \ wget --quiet ${ARBORX_URL} --output-document=${ARBORX_ARCHIVE} && \ @@ -100,7 +100,6 @@ RUN ARBORX_VERSION=4834bff44c23c9510c6ed93366638dcdf85ab217 && \ -D CMAKE_INSTALL_PREFIX=${ARBORX_DIR} \ -D CMAKE_BUILD_TYPE=Debug \ -D CMAKE_CXX_COMPILER=hipcc \ - -D CMAKE_CXX_FLAGS=-amdgpu-target=gfx906 \ -D CMAKE_CXX_EXTENSIONS=OFF \ -D CMAKE_PREFIX_PATH=${KOKKOS_DIR} \ .. && \ From bb6011d07dabcc78a57068fe6d69e00f3792d0c7 Mon Sep 17 00:00:00 2001 From: Sam Reeve <6740307+streeve@users.noreply.github.com> Date: Fri, 9 Feb 2024 14:18:39 -0500 Subject: [PATCH 5/6] fixup: use binning for now in unmanaged memory ex --- .../advanced_aosoa_unmanaged.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example/core_tutorial/04_aosoa_advanced_unmanaged/advanced_aosoa_unmanaged.cpp b/example/core_tutorial/04_aosoa_advanced_unmanaged/advanced_aosoa_unmanaged.cpp index ed476ca07..81f77f427 100644 --- a/example/core_tutorial/04_aosoa_advanced_unmanaged/advanced_aosoa_unmanaged.cpp +++ b/example/core_tutorial/04_aosoa_advanced_unmanaged/advanced_aosoa_unmanaged.cpp @@ -115,13 +115,13 @@ void unmanagedAoAoAExample() } /* - * Use the view in an algorithm, like sort + * Use the view in an algorithm, like binning */ - auto binning_data = Cabana::sortByKey( slice_b ); + auto binning_data = Cabana::binByKey( slice_b, 64 ); Cabana::permute( binning_data, aosoa ); // Check it worked - for ( int i = 1; i < num_tuple; i++ ) + for ( int i = 1; i < num_tuple; i += 2 ) { // We expect it to be monotonically increasing if ( !( slice_b( i - 1 ) <= slice_b( i ) ) ) From 22feee524bd4aa6538c468fa6b363b20a08535dd Mon Sep 17 00:00:00 2001 From: Sam Reeve <6740307+streeve@users.noreply.github.com> Date: Fri, 9 Feb 2024 14:21:13 -0500 Subject: [PATCH 6/6] fixup: unmanaged example print --- .../advanced_aosoa_unmanaged.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/example/core_tutorial/04_aosoa_advanced_unmanaged/advanced_aosoa_unmanaged.cpp b/example/core_tutorial/04_aosoa_advanced_unmanaged/advanced_aosoa_unmanaged.cpp index 81f77f427..ae74de45a 100644 --- a/example/core_tutorial/04_aosoa_advanced_unmanaged/advanced_aosoa_unmanaged.cpp +++ b/example/core_tutorial/04_aosoa_advanced_unmanaged/advanced_aosoa_unmanaged.cpp @@ -109,8 +109,8 @@ void unmanagedAoAoAExample() if ( slice_b( i ) != ( i % VectorLength ) ) { // Unexpected Value - printf( "%d: Unexpected %d != %d \n", __LINE__, slice_b( i ), - i % VectorLength ); + std::cout << "Error: " << slice_b( i ) << " != " << i % VectorLength + << std::endl; } } @@ -127,13 +127,14 @@ void unmanagedAoAoAExample() if ( !( slice_b( i - 1 ) <= slice_b( i ) ) ) { // Unexpected value - printf( "%d: Unexpected %d vs %d \n", __LINE__, slice_b( i - 1 ), - slice_b( i ) ); + std::cout << "Error: " << slice_b( i - 1 ) << " > " << slice_b( i ) + << std::endl; } // We can also set values slice_a( i, 0 ) = i / 2; } + std::cout << "Successful Cabana binning on unmanaged AoSoA." << std::endl; // Clean up local data delete[] local_data;