Project
Loading...
Searching...
No Matches
GPUMemorySizeScalers.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
16#include "GPULogging.h"
17
18using namespace o2::gpu;
19
20void GPUMemorySizeScalers::rescaleMaxMem(size_t newAvailableMemory)
21{
23 double scaleFactor = (double)newAvailableMemory / tmp.availableMemory;
24 if (scaleFactor != 1.) {
25 GPUInfo("Rescaling buffer size limits from %lu to %lu bytes of memory (factor %f)", tmp.availableMemory, newAvailableMemory, scaleFactor);
26 }
27 tpcMaxPeaks = (double)tmp.tpcMaxPeaks * scaleFactor;
28 tpcMaxClusters = (double)tmp.tpcMaxClusters * scaleFactor;
29 tpcMaxStartHits = (double)tmp.tpcMaxStartHits * scaleFactor;
30 tpcMaxRowStartHits = (double)tmp.tpcMaxRowStartHits * scaleFactor;
31 tpcMaxTracklets = (double)tmp.tpcMaxTracklets * scaleFactor;
32 tpcMaxTrackletHits = (double)tmp.tpcMaxTrackletHits * scaleFactor;
33 tpcMaxSectorTracks = (double)tmp.tpcMaxSectorTracks * scaleFactor;
34 tpcMaxSectorTrackHits = (double)tmp.tpcMaxSectorTrackHits * scaleFactor;
35 tpcMaxMergedTracks = (double)tmp.tpcMaxMergedTracks * scaleFactor;
36 tpcMaxMergedTrackHits = (double)tmp.tpcMaxMergedTrackHits * scaleFactor;
37 availableMemory = newAvailableMemory;
38}
void rescaleMaxMem(size_t newAvailableMemory)