diff --git a/GPU/Common/CMakeLists.txt b/GPU/Common/CMakeLists.txt index efac4fc436758..6951c3b2339b8 100644 --- a/GPU/Common/CMakeLists.txt +++ b/GPU/Common/CMakeLists.txt @@ -64,3 +64,8 @@ if(ALIGPU_BUILD_TYPE STREQUAL "O2") endif() install(FILES ${HDRS_INSTALL} DESTINATION include/GPU) endif() + +if(ALIGPU_BUILD_TYPE STREQUAL "Standalone") + install(FILES ${HDRS_INSTALL} + DESTINATION include) +endif() diff --git a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAGenRTC.cxx b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAGenRTC.cxx index c6bbc26977f09..c3d614b8d9f98 100644 --- a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAGenRTC.cxx +++ b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAGenRTC.cxx @@ -59,6 +59,23 @@ int32_t GPUReconstructionCUDA::genRTC(std::string& filename, uint32_t& nCompile) std::string baseCommand = (mProcessingSettings.rtctech.prependCommand != "" ? (mProcessingSettings.rtctech.prependCommand + " ") : ""); baseCommand += (getenv("O2_GPU_RTC_OVERRIDE_CMD") ? std::string(getenv("O2_GPU_RTC_OVERRIDE_CMD")) : std::string(_binary_GPUReconstructionCUDArtc_command_start, _binary_GPUReconstructionCUDArtc_command_len)); baseCommand += std::string(" ") + (mProcessingSettings.rtctech.overrideArchitecture != "" ? mProcessingSettings.rtctech.overrideArchitecture : std::string(_binary_GPUReconstructionCUDArtc_command_arch_start, _binary_GPUReconstructionCUDArtc_command_arch_len)); + + if (mProcessingSettings.rtctech.loadLaunchBoundsFromFile.size()) { + FILE* fp = fopen(mProcessingSettings.rtctech.loadLaunchBoundsFromFile.c_str(), "rb"); + if (fp == nullptr) { + throw std::runtime_error("Cannot open launch bounds parameter module file"); + } + fseek(fp, 0, SEEK_END); + size_t size = ftell(fp); + if (size != sizeof(*mParDevice)) { + throw std::runtime_error("launch bounds parameter file has incorrect size"); + } + fseek(fp, 0, SEEK_SET); + if (fread(mParDevice, 1, size, fp) != size) { + throw std::runtime_error("Error reading launch bounds parameter file"); + } + fclose(fp); + } const std::string launchBounds = o2::gpu::internal::GPUDefParametersExport(*mParDevice, true); if (mProcessingSettings.rtctech.printLaunchBounds || mProcessingSettings.debugLevel >= 3) { GPUInfo("RTC Launch Bounds:\n%s", launchBounds.c_str()); diff --git a/GPU/GPUTracking/CMakeLists.txt b/GPU/GPUTracking/CMakeLists.txt index 33715909e810c..fe2fefe2412c0 100644 --- a/GPU/GPUTracking/CMakeLists.txt +++ b/GPU/GPUTracking/CMakeLists.txt @@ -258,7 +258,7 @@ file(GENERATE if(NOT ALIGPU_BUILD_TYPE STREQUAL "O2") include_directories(${CMAKE_CURRENT_BINARY_DIR}/include_gpu_onthefly) endif() -set(HDRS_INSTALL ${HDRS_INSTALL} ${CMAKE_CURRENT_BINARY_DIR}/include_gpu_onthefly/GPUReconstructionKernelList.h ${CMAKE_CURRENT_BINARY_DIR}/include_gpu_onthefly/GPUDefParameters.h) +set(HDRS_INSTALL ${HDRS_INSTALL} ${CMAKE_CURRENT_BINARY_DIR}/include_gpu_onthefly/GPUReconstructionKernelList.h ${CMAKE_CURRENT_BINARY_DIR}/include_gpu_onthefly/GPUDefParameters.h ${CMAKE_CURRENT_BINARY_DIR}/include_gpu_onthefly/GPUDefParametersLoad.inc) include(kernels.cmake) # Optional sources depending on optional dependencies @@ -376,13 +376,18 @@ if(ALIGPU_BUILD_TYPE STREQUAL "Standalone") if(GPUCA_CONFIG_ROOT) ROOT_GENERATE_DICTIONARY(G__${targetName} ${HDRS_CINT_O2} ${HDRS_CINT_DATATYPES} ${HDRS_CINT_O2_ADDITIONAL} GPUTrackingLinkDef_Standalone.h MODULE ${targetName}) - INSTALL(FILES + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${targetName}_rdict.pcm ${CMAKE_CURRENT_BINARY_DIR}/lib${targetName}.rootmap DESTINATION .) else() target_compile_definitions(${targetName} PRIVATE GPUCA_NO_ROOT) endif() + install(FILES ${HDRS_SRCS} ${HDRS_CINT_O2} ${HDRS_CINT_DATATYPES} ${HDRS_INSTALL} + DESTINATION include) + install(DIRECTORY utils + DESTINATION include + FILES_MATCHING PATTERN *.h) endif() # GPUReconstructionLibrary needs to know which GPU backends are enabled for proper error messages diff --git a/GPU/GPUTracking/Definitions/GPUSettingsList.h b/GPU/GPUTracking/Definitions/GPUSettingsList.h index d3a3fbaff16ff..5d716d32d928f 100644 --- a/GPU/GPUTracking/Definitions/GPUSettingsList.h +++ b/GPU/GPUTracking/Definitions/GPUSettingsList.h @@ -228,6 +228,7 @@ AddOption(printLaunchBounds, bool, false, "", 0, "Print launch bounds used for R AddOption(cacheFolder, std::string, "./rtccache/", "", 0, "Folder in which the cache file is stored") AddOption(prependCommand, std::string, "", "", 0, "Prepend RTC compilation commands by this string") AddOption(overrideArchitecture, std::string, "", "", 0, "Override arhcitecture part of RTC compilation command line") // Part of cmdLine, so checked against the cache +AddOption(loadLaunchBoundsFromFile, std::string, "", "", 0, "Load a parameter object containing the launch bounds from a file") AddHelp("help", 'h') EndConfig() diff --git a/GPU/GPUTracking/Standalone/tools/createGeo.C b/GPU/GPUTracking/Standalone/tools/createGeo.C index 5684f2cc92da6..307d687f716d1 100644 --- a/GPU/GPUTracking/Standalone/tools/createGeo.C +++ b/GPU/GPUTracking/Standalone/tools/createGeo.C @@ -1,3 +1,17 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file CreateGeo.C +/// \author David Rohr + #if !defined(__CLING__) || defined(__ROOTCLING__) #include #include "TRDBase/GeometryFlat.h" diff --git a/GPU/GPUTracking/Standalone/tools/createGeo.sh b/GPU/GPUTracking/Standalone/tools/createGeo.sh index a449e1997a16e..49176f231aa80 100755 --- a/GPU/GPUTracking/Standalone/tools/createGeo.sh +++ b/GPU/GPUTracking/Standalone/tools/createGeo.sh @@ -1,3 +1,14 @@ +# Copyright 2019-2020 CERN and copyright holders of ALICE O2. +# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +# All rights not expressly granted are reserved. +# +# This software is distributed under the terms of the GNU General Public +# License v3 (GPL Version 3), copied verbatim in the file "COPYING". +# +# In applying this license CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization +# or submit itself to any jurisdiction. + #!/bin/bash PATH=$PATH:/usr/share/Modules/bin/:/home/qon/alice/alibuild diff --git a/GPU/GPUTracking/Standalone/tools/createLUT.C b/GPU/GPUTracking/Standalone/tools/createLUT.C index 83e46da29b9a3..7bb4edbf89f18 100644 --- a/GPU/GPUTracking/Standalone/tools/createLUT.C +++ b/GPU/GPUTracking/Standalone/tools/createLUT.C @@ -1,3 +1,17 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file CreateLUT.C +/// \author David Rohr + #if !defined(__CLING__) || defined(__ROOTCLING__) #include #include "DetectorsBase/MatLayerCylSet.h" diff --git a/GPU/GPUTracking/Standalone/tools/dumpGPUDefParam.C b/GPU/GPUTracking/Standalone/tools/dumpGPUDefParam.C new file mode 100644 index 0000000000000..4a2575c40d79a --- /dev/null +++ b/GPU/GPUTracking/Standalone/tools/dumpGPUDefParam.C @@ -0,0 +1,38 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file dumpGPUDefParam.C +/// \author David Rohr + +// Run e.g. as: +// ROOT_INCLUDE_PATH="`pwd`/include" root -l -q -b src/GPU/GPUTracking/Standalone/tools/dumpGPUDefParam.C'()' + +// Logic for testing to load the default parameters +/*#define GPUCA_GPUCODE +#define GPUCA_GPUTYPE_AMPERE +#define GPUCA_DEF_PARAMETERS_LOAD_DEFAULTS +#define GPUCA_MAXN 40 +#define GPUCA_ROW_COUNT 152 +#define GPUCA_TPC_COMP_CHUNK_SIZE 1024 +#include "GPUDefParametersDefault.h"*/ + +// Load file that sets GPUDefParameters +#include "testParam.h" + +#include "GPUDefParametersLoad.inc" +void dumpGPUDefParam() +{ + auto param = o2::gpu::internal::GPUDefParametersLoad(); + printf("Loaded params:\n%s", o2::gpu::internal::GPUDefParametersExport(param, false).c_str()); + FILE* fp = fopen("parameters.out", "w+b"); + fwrite(¶m, 1, sizeof(param), fp); + fclose(fp); +} diff --git a/GPU/GPUTracking/Standalone/tools/dumpTRDClusterMatrices.C b/GPU/GPUTracking/Standalone/tools/dumpTRDClusterMatrices.C index 757875e4199b3..c747a226f5edf 100644 --- a/GPU/GPUTracking/Standalone/tools/dumpTRDClusterMatrices.C +++ b/GPU/GPUTracking/Standalone/tools/dumpTRDClusterMatrices.C @@ -1,3 +1,14 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + #include "AliCDBManager.h" #include "AliGeomManager.h" #include "AliTRDgeometry.h" diff --git a/GPU/GPUTracking/Standalone/tools/switchToAliRootLicense.sh b/GPU/GPUTracking/Standalone/tools/switchToAliRootLicense.sh deleted file mode 100755 index 94545950805a0..0000000000000 --- a/GPU/GPUTracking/Standalone/tools/switchToAliRootLicense.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -cd ../../../../ -if [ $(ls | grep GPU | wc -l) != "1" ]; then - echo Incorrect directory - exit 1 -fi - -git grep -l "^// Copyright 2019-2020 CERN and copyright holders of ALICE O2." | \ - grep "^GPU/Common/\|^GPU/GPUTracking/\|^GPU/TPCFastTransformation|^GPU/TPCSpaceChargeBase\|^cmake" | \ - xargs -r -n 1 \ - sed -i -e '/Copyright 2019-2020 CERN and copyright holders of ALICE O2./,/or submit itself to any jurisdiction/c\ -//**************************************************************************\ -//* This file is property of and copyright by the ALICE Project *\ -//* ALICE Experiment at CERN, All rights reserved. *\ -//* *\ -//* Primary Authors: Matthias Richter *\ -//* for The ALICE HLT Project. *\ -//* *\ -//* Permission to use, copy, modify and distribute this software and its *\ -//* documentation strictly for non-commercial purposes is hereby granted *\ -//* without fee, provided that the above copyright notice appears in all *\ -//* copies and that both the copyright notice and this permission notice *\ -//* appear in the supporting documentation. The authors make no claims *\ -//* about the suitability of this software for any purpose. It is *\ -//* provided "as is" without express or implied warranty. *\ -//**************************************************************************\'