Skip to content

Commit

Permalink
Fixed standalone compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
ariostas committed Jul 17, 2024
1 parent 64a7bf1 commit c4ac510
Show file tree
Hide file tree
Showing 10 changed files with 197 additions and 179 deletions.
2 changes: 1 addition & 1 deletion RecoTracker/LSTCore/standalone/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ OBJECTS=$(OBJECTS_CPU) $(OBJECTS_CUDA) $(OBJECTS_ROCM)

CXX = g++
CXXFLAGS = -g -O2 -Wall -fPIC -Wshadow -Woverloaded-virtual -Wno-unused-function -fno-var-tracking -std=c++17
INCLUDEFLAGS= -ISDL -I$(shell pwd) -Icode -Icode/core -I${ALPAKA_ROOT}/include -I/${BOOST_ROOT}/include $(shell rooutil-config --include) -I$(shell root-config --incdir) -I${TRACKLOOPERDIR}/../../../ -I${CMSSW_BASE}/src -I../interface/alpaka/ -I../src/alpaka/
INCLUDEFLAGS= -ISDL -I$(shell pwd) -Icode -Icode/core -I${ALPAKA_ROOT}/include -I/${BOOST_ROOT}/include $(shell rooutil-config --include) -I$(shell root-config --incdir) -I${TRACKLOOPERDIR}/../../../ -I${CMSSW_BASE}/src -I../interface/ -I../interface/alpaka/ -I../src/ -I../src/alpaka/
ifdef CMSSW_RELEASE_BASE
INCLUDEFLAGS:= ${INCLUDEFLAGS} -I${CMSSW_RELEASE_BASE}/src
endif
Expand Down
18 changes: 14 additions & 4 deletions RecoTracker/LSTCore/standalone/SDL/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
# stuff to make
#

CCSOURCES=$(filter-out ../../src.alpaka/LST.dev.cc, $(wildcard ../../src/alpaka/*.dev.cc))
CCOBJECTS_CPU=$(patsubst ../../src/alpaka/%.dev.cc, %_cpu.o, $(CCSOURCES))
CCOBJECTS_CUDA=$(patsubst ../../src/alpaka/%.dev.cc, %_cuda.o, $(CCSOURCES))
CCOBJECTS_ROCM=$(patsubst ../../src/alpaka/%.dev.cc, %_rocm.o, $(CCSOURCES))
CCSOURCES=$(wildcard ../../src/*.cc)
ALPAKACCSOURCES=$(filter-out ../../src.alpaka/LST.dev.cc, $(wildcard ../../src/alpaka/*.dev.cc))
CCOBJECTS_CPU=$(patsubst ../../src/alpaka/%.dev.cc, %_cpu.o, $(ALPAKACCSOURCES)) $(patsubst ../../src/%.cc, %_cpu.o, $(CCSOURCES))
CCOBJECTS_CUDA=$(patsubst ../../src/alpaka/%.dev.cc, %_cuda.o, $(ALPAKACCSOURCES)) $(patsubst ../../src/%.cc, %_cuda.o, $(CCSOURCES))
CCOBJECTS_ROCM=$(patsubst ../../src/alpaka/%.dev.cc, %_rocm.o, $(ALPAKACCSOURCES)) $(patsubst ../../src/%.cc, %_rocm.o, $(CCSOURCES))

LSTSOURCES=../../src/alpaka/LST.dev.cc
LSTOBJECTS_CPU=$(patsubst ../../src/alpaka/%.dev.cc, %_cpu.o, $(LSTSOURCES))
Expand Down Expand Up @@ -99,6 +100,15 @@ CUTVALUEFLAG_FLAGS = -DCUT_VALUE_DEBUG
%_rocm.o: ../../src/alpaka/%.dev.cc
$(COMPILE_CMD_ROCM) $(CXXFLAGS_ROCM) $(ROOTINCLUDE) $(PRINTFLAG) $(CACHEFLAG) $(CUTVALUEFLAG) $(LSTWARNINGSFLAG) $(CMSSW_WERRORS_ROCM) $(T5CUTFLAGS) $(PTCUTFLAG) $(DUPLICATES) $(ALPAKAINCLUDE) $(ALPAKABACKEND_ROCM) $< -o $@

%_cpu.o: ../../src/%.cc
$(COMPILE_CMD_CPU) $(CXXFLAGS_CPU) $(ROOTINCLUDE) $(PRINTFLAG) $(CACHEFLAG) $(CUTVALUEFLAG) $(LSTWARNINGSFLAG) $(CMSSW_WERRORS_CPU) $(T5CUTFLAGS) $(PTCUTFLAG) $(DUPLICATES) $(ALPAKAINCLUDE) $(ALPAKABACKEND_CPU) $< -o $@

%_cuda.o: ../../src/%.cc
$(COMPILE_CMD_CUDA) $(CXXFLAGS_CUDA) $(ROOTINCLUDE) $(PRINTFLAG) $(CACHEFLAG) $(CUTVALUEFLAG) $(LSTWARNINGSFLAG) $(CMSSW_WERRORS_CUDA) $(T5CUTFLAGS) $(PTCUTFLAG) $(DUPLICATES) $(ALPAKAINCLUDE) $(ALPAKABACKEND_CUDA) $< -o $@

%_rocm.o: ../../src/%.cc
$(COMPILE_CMD_ROCM) $(CXXFLAGS_ROCM) $(ROOTINCLUDE) $(PRINTFLAG) $(CACHEFLAG) $(CUTVALUEFLAG) $(LSTWARNINGSFLAG) $(CMSSW_WERRORS_ROCM) $(T5CUTFLAGS) $(PTCUTFLAG) $(DUPLICATES) $(ALPAKAINCLUDE) $(ALPAKABACKEND_ROCM) $< -o $@

$(LIB_CPU): $(CCOBJECTS_CPU) $(LSTOBJECTS_CPU)
$(LD_CPU) $(SOFLAGS_CPU) $^ -o $@

Expand Down
16 changes: 9 additions & 7 deletions RecoTracker/LSTCore/standalone/bin/sdl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <typeinfo>

using namespace ALPAKA_ACCELERATOR_NAMESPACE;

//___________________________________________________________________________________________________________________________________________________________________________________________
int main(int argc, char **argv) {
//********************************************************************************
Expand Down Expand Up @@ -253,7 +255,7 @@ int main(int argc, char **argv) {

// Printing out the option settings overview
std::cout << "=========================================================" << std::endl;
std::cout << " Running for Acc = " << alpaka::getAccName<SDL::Acc>() << std::endl;
std::cout << " Running for Acc = " << alpaka::getAccName<Acc3D>() << std::endl;
std::cout << " Setting of the analysis job based on provided arguments " << std::endl;
std::cout << "---------------------------------------------------------" << std::endl;
std::cout << " ana.input_file_list_tstring: " << ana.input_file_list_tstring << std::endl;
Expand Down Expand Up @@ -296,18 +298,18 @@ int main(int argc, char **argv) {

//___________________________________________________________________________________________________________________________________________________________________________________________
void run_sdl() {
SDL::Dev devAcc = alpaka::getDevByIdx(ALPAKA_ACCELERATOR_NAMESPACE::Platform{}, 0u);
std::vector<SDL::QueueAcc> queues;
Device devAcc = alpaka::getDevByIdx(ALPAKA_ACCELERATOR_NAMESPACE::Platform{}, 0u);
std::vector<Queue> queues;
for (int s = 0; s < ana.streams; s++) {
queues.push_back(SDL::QueueAcc(devAcc));
queues.push_back(Queue(devAcc));
}

// Load various maps used in the SDL reconstruction
TStopwatch full_timer;
full_timer.Start();
auto hostESData = SDL::loadAndFillESHost();
auto deviceESData =
cms::alpakatools::CopyToDevice<SDL::LSTESData<SDL::DevHost>>::copyAsync(queues[0], *hostESData.get());
cms::alpakatools::CopyToDevice<SDL::LSTESData<DevHost>>::copyAsync(queues[0], *hostESData.get());
float timeForMapLoading = full_timer.RealTime() * 1000;

if (ana.do_write_ntuple) {
Expand Down Expand Up @@ -383,9 +385,9 @@ void run_sdl() {

full_timer.Reset();
full_timer.Start();
std::vector<SDL::Event<SDL::Acc> *> events;
std::vector<SDL::Event<Device> *> events;
for (int s = 0; s < ana.streams; s++) {
SDL::Event<SDL::Acc> *event = new SDL::Event<SDL::Acc>(ana.verbose >= 2, queues[s], &deviceESData);
SDL::Event<Device> *event = new SDL::Event<Device>(ana.verbose >= 2, queues[s], &deviceESData);
events.push_back(event);
}
float timeForEventCreation = full_timer.RealTime() * 1000;
Expand Down
Loading

0 comments on commit c4ac510

Please sign in to comment.