Skip to content

Commit

Permalink
remove cupla in comments and documentation
Browse files Browse the repository at this point in the history
- update clang-format and remove cupla include rule
- update CI checks for cupla includes
- update documantion (dependency image)
- update code comments
  • Loading branch information
psychocoderHPC committed Mar 4, 2024
1 parent 1c425a2 commit 208af4d
Show file tree
Hide file tree
Showing 32 changed files with 92 additions and 136 deletions.
11 changes: 4 additions & 7 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -113,22 +113,19 @@ IncludeCategories:
# <pmacc/foo.hpp>
- Regex: '<pmacc/([A-Za-z0-9.\/-_])+>'
Priority: 4
# <cupla/foo.hpp>
- Regex: '<cupla/([A-Za-z0-9.\/-_])+>'
Priority: 5
# <alpaka/foo.hpp>
- Regex: '<alpaka/([A-Za-z0-9.\/-_])+>'
Priority: 6
Priority: 5
# <boost/foo.hpp>
- Regex: '<boost/([A-Za-z0-9.\/-_])+>'
Priority: 7
Priority: 6
# C++ standard library headers are the last group to be included
- Regex: '<([A-Za-z0-9\/-_])+>'
Priority: 8
Priority: 7
# Includes that made it this far are third-party headers and will be placed
# below picongpu/pmacc includes
- Regex: '<([A-Za-z0-9.\/-_])+>'
Priority: 9
Priority: 8

# Future options - not supported in clang-format 12
#
Expand Down
4 changes: 0 additions & 4 deletions INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@ alpaka 1.1.X
""""""""""""""""
- `alpaka <https://github.com/alpaka-group/alpaka>`_ is included in the PIConGPU source code

cupla 0.5.X-dev
"""""""""""""""
- `cupla <https://github.com/alpaka-group/cupla>`_ is included in the PIConGPU source code

mallocMC 2.6.0crp-dev
"""""""""""""""""""""
- only required for CUDA and HIP backends
Expand Down
2 changes: 1 addition & 1 deletion docs/source/dev/debugging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The following build options can assist the investigation:
* ``PIC_VERBOSE=<N>`` sets log detail level for PIConGPU, highest level is 127.
* ``PMACC_VERBOSE=<N>`` sets log detail level for pmacc, highest level is 127.
* ``PMACC_BLOCKING_KERNEL=ON`` makes each kernel invocation blocking, which helps to narrow a crash down to a particular kernel.
* ``CUPLA_STREAM_ASYNC_ENABLE=OFF`` disables asynchronous streams, also helps to narrow a crash down to a particular place.
* ``PMACC_ASYNC_QUEUES=OFF`` disables asynchronous alpaka queues, also helps to narrow a crash down to a particular place.
* ``CMAKE_BUILD_TYPE=Debug`` compile in debug mode where all assertions are activated. Compiling in debug mode will slowdown your kernels!

These options can be passed when building, or manually modified via cmake.
Expand Down
4 changes: 2 additions & 2 deletions docs/source/dev/extending.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ Otherwise, one often has to implement an own kernel.
Writing a Kernel
----------------

Computational kernels are written using library `cupla <https://github.com/alpaka-group/cupla>`_ which is a layer on top of library `alpaka <https://github.com/alpaka-group/alpaka>`_.
Computational kernels are written using library `alpaka <https://github.com/alpaka-group/alpaka>`_.
Most kernel functors are templates parametrized with the number of threads per block, often called ``numWorkers``.
Kernel invocations are wrapped into a helper macro ``PMACC_KERNEL``.
Kernel invocations are wrapped into a helper macro ``PMACC_KERNEL`` or ``PMACC_LOCKSTEP_KERNEL``.

A vast majority of PIConGPU kernels operate on two levels of parallelism: between supercells and inside each supercell.
This parallel pattern is covered by the mapper concept.
Expand Down
2 changes: 0 additions & 2 deletions docs/source/install/libraryDependencies.dot
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ digraph PIConGPU {

compiler -> alpaka;
boost -> alpaka;
alpaka -> cupla;

mallocmc [label="mallocMC"]
alpaka -> mallocmc;
Expand Down Expand Up @@ -53,7 +52,6 @@ digraph PIConGPU {

picongpu [label="PIConGPU"];
alpaka -> picongpu;
cupla -> picongpu;
mpi -> picongpu;
boost -> picongpu;
mallocmc -> picongpu;
Expand Down
2 changes: 1 addition & 1 deletion include/picongpu/fields/currentDeposition/Strategy.def
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ namespace picongpu

/** Default strategy for the current deposition
*
* Default will be selected based on the cupla accelerator.
* Default will be selected based on the alpaka accelerator.
*
* @tparam T_Acc the accelerator type
*/
Expand Down
2 changes: 1 addition & 1 deletion include/picongpu/particles/Particles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace picongpu
using namespace pmacc;

#if(!BOOST_LANG_CUDA && !BOOST_COMP_HIP)
/* dummy because we are not using mallocMC with cupla
/* dummy because we are not using mallocMC with CPU backends
* DeviceHeap is defined in `mallocMC.param`
*/
struct DeviceHeap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,6 @@ namespace picongpu
else
{
// Otherwise we add it to a collection of new bins
// Note: in current dev the namespace is different in cupla
// get Index where to deposit it by atomic add to numNewBins
// this assures that the same index is not used twice
auto newBinIdx = alpaka::atomicAdd(
worker.getAcc(),
&numNewBins,
Expand Down
4 changes: 2 additions & 2 deletions include/picongpu/plugins/BinEnergyParticles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace picongpu
*
* @tparam T_ParBox pmacc::ParticlesBox, particle box type
* @tparam T_BinBox pmacc::DataBox, box type for the histogram in global memory
* @tparam T_Mapping type of the mapper to map a cupla block to a supercell index
* @tparam T_Mapping type of the mapper to map an alpaka block to a supercell index
* @tparam T_Worker lockstep worker type
*
* @param acc alpaka accelerator
Expand All @@ -80,7 +80,7 @@ namespace picongpu
* @param numBins number of bins in the histogram (must be fit into the shared memory)
* @param minEnergy particle energy for the first bin
* @param maxEnergy particle energy for the last bin
* @param mapper functor to map a cupla block to a supercells index
* @param mapper functor to map an alpaka block to a supercells index
*/
template<typename T_ParBox, typename T_BinBox, typename T_Mapping, typename T_Filter, typename T_Worker>
DINLINE void operator()(
Expand Down
4 changes: 2 additions & 2 deletions include/picongpu/plugins/kernel/CopySpecies.kernel
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace picongpu
* @tparam T_Filter type of filer with particle selection rules
* @tparam T_Space type of coordinate description
* @tparam T_Identifier type of identifier for the particle cellIdx
* @tparam T_Mapping type of the mapper to map cupla idx to supercells
* @tparam T_Mapping type of the mapper to map alpaka idx to supercells
* @tparam T_Worker lockstep worker type
*
* @param worker lockstep worker
Expand All @@ -54,7 +54,7 @@ namespace picongpu
* @param domainCellIdxIdentifier the identifier for the particle cellIdx
* that is calculated with respect to
* domainOffset
* @param mapper map cupla idx to supercells
* @param mapper map alpaka idx to supercells
*/
template<
typename T_DestFrame,
Expand Down
2 changes: 1 addition & 1 deletion include/picongpu/plugins/openPMD/Json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
/*
* Note:
* This is a hostonly .cpp file because CMake will not use -isystem for system
* include paths on NVCC targets created with cupla_add_executable.
* include paths on NVCC targets created with alpaka_add_executable.
* Since <nlohmann/json.hpp> throws a number of warnings, this .cpp file
* ensures that NVCC never sees that library.
*/
Expand Down
2 changes: 1 addition & 1 deletion include/picongpu/plugins/openPMD/Json_private.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Note:
* This header is included only into hostonly .cpp files because CMake
* will not use -isystem for system include paths on NVCC targets created
* with cupla_add_executable.
* with alpaka_add_executable.
* Since <nlohmann/json.hpp> throws a number of warnings, this design
* ensures that NVCC never sees that library.
*/
Expand Down
6 changes: 3 additions & 3 deletions include/pmacc/Environment.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,10 @@ namespace pmacc
int numAvailableDevices = manager::Device<ComputeDevice>::get().count();

#if(BOOST_LANG_CUDA || BOOST_COMP_HIP)
// ##ERROR handling
if(numAvailableDevices < 1) // check if cupla device is found
// check if device is found
if(numAvailableDevices < 1)
{
throw std::runtime_error("no CUDA capable devices detected");
throw std::runtime_error("no capable alpaka compute devices detected");
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/pmacc/PMaccConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ endif()
# setup alpaka
################################################################################

# the min and max. supported alpaka version is also copied to the cuplaConfig.cmake
set(_PMACC_MIN_ALPAKA_VERSION 1.0.0)
# the min and max. supported alpaka version
set(_PMACC_MIN_ALPAKA_VERSION 1.1.0)
set(_PMACC_MAX_ALPAKA_VERSION 1.1.0)

# do not search for alpaka if it already exists
Expand Down
2 changes: 0 additions & 2 deletions include/pmacc/algorithms/GlobalReduce.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ namespace pmacc
{
public:
/** Constructor
*
* @attetion Don't create a instance before you have set you cupla device!
*
* @param byte how many bytes in global gpu memory can be reserved for the reduction algorithm
* @param sharedMemByte limit the usage of shared memory per block on gpu
Expand Down
11 changes: 4 additions & 7 deletions include/pmacc/alpakaHelper/ValidateCall.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,15 @@
#include <stdexcept>


/**
* Print a cupla error message including file/line info to stderr
/** Print a error message including file/line info to stderr
*/
#define PMACC_PRINT_ALPAKA_ERROR(msg) \
do \
{ \
std::cerr << "[alpaka] Error: <" << __FILE__ << ">:" << __LINE__ << " " << msg << std::endl; \
} while(false)

/**
* Print a cupla error message including file/line info to stderr and raises an exception
/** Print a error message including file/line info to stderr and raises an exception
*/
#define PMACC_PRINT_ALPAKA_ERROR_AND_THROW(msg) \
do \
Expand All @@ -48,10 +46,9 @@
throw std::runtime_error(std::string("[alpaka] Error: ") + msg); \
} while(false)

/**
* Captures CUDA errors and prints messages to stdout, including line number and file.
/** Captures an expression in a catch throw block and prints messages to stdout, including line number and file.
*
* @param cmd command with cuplaError_t return value to check
* @param ... expression to capture in a catch throw block
*/
#define PMACC_CHECK_ALPAKA_CALL(...) \
do \
Expand Down
4 changes: 2 additions & 2 deletions include/pmacc/device/reduce/Kernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ namespace pmacc
*
* This method can be used to reduce a chunk of an array.
* This method is a **collective** method and needs to be called by all
* threads within a cupla block.
* threads within a alpaka block.
*
* @tparam T_SrcBuffer type of the buffer
* @tparam T_Functor type of the binary functor to reduce two elements
Expand All @@ -125,7 +125,7 @@ namespace pmacc
* first argument is the source and get the new reduced value.
* @param sharedMem shared memory buffer with storage for `linearThreadIdxInBlock` elements,
* buffer must implement `operator[](size_t)` (one dimensional access)
* @param blockIndex index of the cupla block,
* @param blockIndex index of the alpaka block,
* for a global reduce: `device::getBlockIdx(worker.getAcc()).x()`,
* for a reduce within a block: `0`
*
Expand Down
21 changes: 11 additions & 10 deletions include/pmacc/device/threadInfo.hpp
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
/* Copyright 2024 Rene Widera
/* Copyright 2014 Rene Widera
*
* This file is part of cupla.
* This file is part of PMacc.
*
* 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
* PMacc is free software: you can redistribute it and/or modify
* it under the terms of either the GNU General Public License or
* 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,
* PMacc 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.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License and 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.
* You should have received a copy of the GNU General Public License
* and the GNU Lesser General Public License along with PMacc.
* If not, see <http://www.gnu.org/licenses/>.
*
*/

#pragma once
Expand Down
14 changes: 7 additions & 7 deletions include/pmacc/eventSystem/events/CudaEvent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ namespace pmacc
class CudaEvent
{
private:
/** native cupla event */
/** native alpaka event */
AlpakaEventType event;
/** native cupla stream where the event is recorded
/** native alpaka queue where the event is recorded
*
* only valid if isRecorded is true
*/
std::optional<AccStream> stream;
/** state if a recorded event is finished
*
* avoid cupla driver calls after `isFinished()` returns the first time true
* avoids that alpaka calls backend API methods after `isFinished()` returns the first time true
*/
bool finished{true};

Expand All @@ -55,7 +55,7 @@ namespace pmacc
public:
/** Constructor
*
* if called before the cupla device is initialized the behavior is undefined
* if called before the alpaka device is initialized the behavior is undefined
*/
CudaEvent();

Expand All @@ -70,7 +70,7 @@ namespace pmacc

/** get native AlpakaEventType object
*
* @return native cupla event
* @return native alpaka event
*/
AlpakaEventType operator*() const
{
Expand All @@ -79,7 +79,7 @@ namespace pmacc

/** get stream in which this event is recorded
*
* @return native cupla stream
* @return native alpaka queue
*/
AccStream getStream() const
{
Expand All @@ -95,7 +95,7 @@ namespace pmacc

/** record event in a device stream
*
* @param stream native cupla stream
* @param stream native alpaka queue
*/
void recordEvent(AccStream const& stream);
};
Expand Down
10 changes: 5 additions & 5 deletions include/pmacc/eventSystem/events/CudaEventHandle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ namespace pmacc
~CudaEventHandle();

/**
* get native cupla event
* get native alpaka event
*
* @return native cupla event
* @return native alpaka event
*/
AlpakaEventType operator*() const;

Expand All @@ -75,13 +75,13 @@ namespace pmacc

/** get stream in which this event is recorded
*
* @return native cupla stream
* @return native alpaka queue
*/
AccStream getStream() const;

/** record event in a device stream
/** record event in a device queue
*
* @param stream native cupla stream
* @param stream native alpaka queue
*/
void recordEvent(AccStream const& stream);
};
Expand Down
Loading

0 comments on commit 208af4d

Please sign in to comment.