Commit c8dd8b94 authored by Guilherme Lima's avatar Guilherme Lima 😬
Browse files

Add GPU transfer testing for cms2018 geometry

parent 4680b789
......@@ -258,9 +258,9 @@ if(VECGEOM_ENABLE_CUDA)
add_test(NAME MapTest COMMAND MapTest)
add_test(NAME BVHTest COMMAND BVHTest ${PROJECT_SOURCE_DIR}/persistency/gdml/gdmls/trackML.gdml)
add_test(NAME GeometryTest COMMAND $<TARGET_FILE:GeometryTest> ${PROJECT_SOURCE_DIR}/persistency/gdml/gdmls/trackML.gdml)
add_test(NAME cms2018-Test COMMAND $<TARGET_FILE:GeometryTest> ${PROJECT_SOURCE_DIR}/persistency/gdml/gdmls/cms2018.gdml)
endif()
################################################################################
# - Shape Tester tests
set(TEST_EXECUTABLES_SHAPETESTER
......
......@@ -90,7 +90,8 @@ int main(int argc, char **argv)
cudaManager.Synchronize();
printf("Visiting device geometry ... ");
auto deviceGeometry = visitDeviceGeometry(cudaManager.world_gpu());
const std::size_t numVols = geoManager.GetTotalNodeCount();
auto deviceGeometry = visitDeviceGeometry(cudaManager.world_gpu(), numVols);
printf("Comparing to host geometry ... ");
std::size_t volumeCounter = 0;
......
......@@ -32,15 +32,13 @@ __global__ void kernel_visitDeviceGeometry(const vecgeom::cuda::VPlacedVolume *v
visitVolumes(volume, geoData, g_volumesVisited, nGeoData, 0);
}
std::vector<GeometryInfo> visitDeviceGeometry(const vecgeom::cuda::VPlacedVolume *volume)
std::vector<GeometryInfo> visitDeviceGeometry(const vecgeom::cuda::VPlacedVolume *volume, std::size_t maxElem)
{
auto err = cudaDeviceSynchronize();
if (err != cudaSuccess) {
errx(2, "Cuda error before visiting device geometry: '%s'", cudaGetErrorString(err));
}
constexpr std::size_t maxElem = 100000;
GeometryInfo *geoDataGPU;
cudaMalloc(&geoDataGPU, maxElem * sizeof(GeometryInfo));
......
......@@ -40,4 +40,4 @@ struct GeometryInfo {
}
};
std::vector<GeometryInfo> visitDeviceGeometry(const vecgeom::cuda::VPlacedVolume *volume);
\ No newline at end of file
std::vector<GeometryInfo> visitDeviceGeometry(const vecgeom::cuda::VPlacedVolume* volume, std::size_t numVols);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment