diff --git a/algo/CMakeLists.txt b/algo/CMakeLists.txt index 34b6976ae8335544695d5665fcd58b913ba980cc..48571713f093dab8540f17068f2089c9563d6ceb 100644 --- a/algo/CMakeLists.txt +++ b/algo/CMakeLists.txt @@ -2,6 +2,7 @@ add_subdirectory(data) add_subdirectory(test) set(DEVICE_SRCS + base/gpu/DeviceImage.cxx detectors/sts/UnpackStsXpu.cxx ) @@ -28,6 +29,7 @@ add_library(Algo SHARED ${SRCS}) target_include_directories(Algo PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/base ${CMAKE_CURRENT_SOURCE_DIR}/evbuild ${CMAKE_CURRENT_SOURCE_DIR}/trigger ${CMAKE_CURRENT_SOURCE_DIR}/evselector @@ -43,6 +45,9 @@ target_compile_definitions(Algo PUBLIC NO_ROOT) xpu_attach(Algo ${DEVICE_SRCS}) install(TARGETS Algo DESTINATION lib) +install(DIRECTORY base/gpu TYPE INCLUDE + FILES_MATCHING PATTERN "*.h" +) install(FILES ca/simd/CaSimd.h ca/simd/CaSimdVc.h diff --git a/algo/base/gpu/DeviceImage.cxx b/algo/base/gpu/DeviceImage.cxx new file mode 100644 index 0000000000000000000000000000000000000000..c54939a1cbc4eacaf05869eeb348847f4d5c0fff --- /dev/null +++ b/algo/base/gpu/DeviceImage.cxx @@ -0,0 +1,6 @@ +/* Copyright (C) 2023 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main + SPDX-License-Identifier: GPL-3.0-only + Authors: Felix Weiglhofer [committer] */ +#include "DeviceImage.h" + +XPU_IMAGE(cbm::algo::GPUReco); diff --git a/algo/base/gpu/DeviceImage.h b/algo/base/gpu/DeviceImage.h new file mode 100644 index 0000000000000000000000000000000000000000..14a84da25e53aa41658544e5b84ce84a9b1cb910 --- /dev/null +++ b/algo/base/gpu/DeviceImage.h @@ -0,0 +1,14 @@ +/* Copyright (C) 2023 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main + SPDX-License-Identifier: GPL-3.0-only + Authors: Felix Weiglhofer [committer] */ +#ifndef CBM_ALGO_BASE_GPU_DEVICEIMAGE_H +#define CBM_ALGO_BASE_GPU_DEVICEIMAGE_H +#include <xpu/device.h> + +namespace cbm::algo +{ + struct GPUReco { + }; +} // namespace cbm::algo + +#endif diff --git a/algo/detectors/sts/UnpackStsXpu.cxx b/algo/detectors/sts/UnpackStsXpu.cxx index b07d6e188174b88a43afcf29e8af3c1bbc6ae8be..7c9a5556359113b226e4906c21ffc66212403ee0 100644 --- a/algo/detectors/sts/UnpackStsXpu.cxx +++ b/algo/detectors/sts/UnpackStsXpu.cxx @@ -15,8 +15,6 @@ using std::unique_ptr; using std::vector; -XPU_IMAGE(cbm::algo::UnpackStsXpu::StsXpuUnpack); // Call exactly once per library - XPU_BLOCK_SIZE_1D(cbm::algo::UnpackStsXpu::Unpack, 32); namespace cbm::algo diff --git a/algo/detectors/sts/UnpackStsXpu.h b/algo/detectors/sts/UnpackStsXpu.h index 649aa14761e11dbad4b69adf03e46274b712bfbd..1e88b7f5ea08800f15ba89ed5a54991bbdf54e93 100644 --- a/algo/detectors/sts/UnpackStsXpu.h +++ b/algo/detectors/sts/UnpackStsXpu.h @@ -5,7 +5,6 @@ #ifndef CBM_ALGO_UNPACKSTSXPU_H #define CBM_ALGO_UNPACKSTSXPU_H 1 - #include "CbmStsDigi.h" #include "MicrosliceDescriptor.hpp" @@ -22,6 +21,7 @@ #include "StsReadoutConfig.h" #include "StsXyterMessage.h" +#include "gpu/DeviceImage.h" namespace cbm::algo @@ -107,7 +107,7 @@ namespace cbm::algo // Run unpacker for each microslice - XPU_EXPORT_KERNEL(StsXpuUnpack, Unpack, UnpackStsXpuPar* params, UnpackStsXpuElinkPar* elinkParams, + XPU_EXPORT_KERNEL(GPUReco, Unpack, UnpackStsXpuPar* params, UnpackStsXpuElinkPar* elinkParams, stsxyter::Message* content, uint64_t* msMessCount, uint64_t* msMessOffset, uint64_t* msStartTime, uint32_t* msCompIdx, CbmStsDigi* digisOut, const uint64_t currentTsTime, int NElems);