Skip to content

Commit

Permalink
Squashed 'thirdParty/cupla/' changes from f60a0ac72c..ed00837ef6
Browse files Browse the repository at this point in the history
ed00837ef6 Merge pull request ComputationalRadiationPhysics#163 from psychocoderHPC/fix-atomicFunctions
a028b2e3e3 fix atomic function return type
b059405c8b Merge pull request ComputationalRadiationPhysics#161 from psychocoderHPC/topic-nativeCuplaUsage
580352ebef usage of cupla without cuda renaming macros
35a564c1c8 Merge pull request ComputationalRadiationPhysics#159 from psychocoderHPC/fix-docuKernelCall
b54c71fd15 fix `KernelWithElementLevel` documentation
REVERT: f60a0ac72c Merge pull request ComputationalRadiationPhysics#155 from ComputationalRadiationPhysics/dev

git-subtree-dir: thirdParty/cupla
git-subtree-split: ed00837ef6eecfce7a23577c954cce51e1c6821c
  • Loading branch information
Third Party authored and psychocoderHPC committed Mar 17, 2020
1 parent 67867d2 commit 8689202
Show file tree
Hide file tree
Showing 15 changed files with 888 additions and 42 deletions.
7 changes: 7 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
&& cmake $cupla_DIR/example/CUDASamples/vectorAdd/ $CMAKE_FLAGS -DCMAKE_BUILD_TYPE=$CUPLA_BUILD_TYPE
&& make -j
&& time ./vectorAdd 100000
&& rm -r *
&& echo "###################################################"
&& echo "Example cuplaVectorAdd (added elements layer)"
&& echo "###################################################"
&& cmake $cupla_DIR/example/CUDASamples/cuplaVectorAdd/ $CMAKE_FLAGS -DCMAKE_BUILD_TYPE=$CUPLA_BUILD_TYPE
&& make -j
&& time ./cuplaVectorAdd 100000
&& rm -r * ;
done

Expand Down
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ before_install:
- mkdir -p $HOME/asyncAPI
- mkdir -p $HOME/asyncAPI_tuned
- mkdir -p $HOME/vectorAdd
- mkdir -p $HOME/cuplaVectorAdd
- mkdir -p $HOME/blackScholes
- mkdir -p $HOME/test/config
- export CMAKE_FLAGS="-DALPAKA_ACC_"$STRATEGY"_ENABLE=ON"
Expand Down Expand Up @@ -157,6 +158,16 @@ script:
./vectorAdd 100000;
fi
#############################################################################
# Example: cuplaVectorAdd (added elements layer) #
#############################################################################
- cd $HOME/cuplaVectorAdd
- cmake $TRAVIS_BUILD_DIR/example/CUDASamples/cuplaVectorAdd/ $CMAKE_FLAGS
- make
- if [ $STRATEGY == "CPU_B_OMP2_T_SEQ" ] ||
[ $STRATEGY == "CPU_B_SEQ_T_SEQ" ]; then
./cuplaVectorAdd 100000;
fi
#############################################################################
# Example: BlackScholes (adapted original) #
#############################################################################
- cd $HOME/blackScholes
Expand Down
67 changes: 67 additions & 0 deletions example/CUDASamples/cuplaVectorAdd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#
# Copyright 2016-2020 Rene Widera, Benjamin Worpitz, Vincent Ridder
#
# This file is part of cupla.
#
# cupla is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cupla is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with cupla.
# If not, see <http://www.gnu.org/licenses/>.
#

################################################################################
# Required CMake version.
################################################################################

cmake_minimum_required(VERSION 3.11.4)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

################################################################################
# Project.
################################################################################

project(cuplaVectorAdd)

################################################################################
# CMake policies
#
# Search in <PackageName>_ROOT:
# https://cmake.org/cmake/help/v3.12/policy/CMP0074.html#
################################################################################

if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()

################################################################################
# Find cupla
################################################################################

set(cupla_ROOT "$ENV{CUPLA_ROOT}" CACHE STRING "The location of the cupla library")

list(APPEND CMAKE_MODULE_PATH "${cupla_ROOT}")
find_package(cupla REQUIRED)


################################################################################
# Add library.
################################################################################

set(_SOURCE_DIR "src/")

# Add all the source files in all recursive subdirectories and group them accordingly.
append_recursive_files_add_to_src_group("${_SOURCE_DIR}" "" "cpp" _FILES_SOURCE_CXX)

# Always add all files to the target executable build call to add them to the build project.
cupla_add_executable(${PROJECT_NAME} ${_FILES_SOURCE_CXX})

9 changes: 9 additions & 0 deletions example/CUDASamples/cuplaVectorAdd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# vector add example with native cupla interface

This example is equal to `vectorAdd` but is not relying on the compatibility header included with (`cuda_to_cupla.hpp`)
to allow the usage of CUDA function names and types.

CUDA prefixed functions/types are prefix with cupla instead.
CUDA functions/types those are not prefixed life in the namespace `cupla`.
Functions call need always the current used accelerator instance.
Non standard global variables like `threadIdx`, `blockDim` should be used as functions from the namespace `cupla`.
Loading

0 comments on commit 8689202

Please sign in to comment.