File tree Expand file tree Collapse file tree 3 files changed +14
-10
lines changed
Expand file tree Collapse file tree 3 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -49,14 +49,6 @@ ur_result_t umf2urResult(umf_result_t umfResult) {
4949}
5050
5151usm::DisjointPoolAllConfigs InitializeDisjointPoolConfig () {
52- const char *PoolUrConfigVal = std::getenv (" SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR" );
53- const char *PoolPiConfigVal = std::getenv (" UR_L0_USM_ALLOCATOR" );
54- const char *PoolConfigVal =
55- PoolUrConfigVal ? PoolUrConfigVal : PoolPiConfigVal;
56- if (PoolConfigVal == nullptr ) {
57- return usm::DisjointPoolAllConfigs ();
58- }
59-
6052 const char *PoolUrTraceVal = std::getenv (" UR_L0_USM_ALLOCATOR_TRACE" );
6153 const char *PoolPiTraceVal =
6254 std::getenv (" SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR_TRACE" );
@@ -69,6 +61,14 @@ usm::DisjointPoolAllConfigs InitializeDisjointPoolConfig() {
6961 PoolTrace = std::atoi (PoolTraceVal);
7062 }
7163
64+ const char *PoolUrConfigVal = std::getenv (" SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR" );
65+ const char *PoolPiConfigVal = std::getenv (" UR_L0_USM_ALLOCATOR" );
66+ const char *PoolConfigVal =
67+ PoolUrConfigVal ? PoolUrConfigVal : PoolPiConfigVal;
68+ if (PoolConfigVal == nullptr ) {
69+ return usm::DisjointPoolAllConfigs (PoolTrace);
70+ }
71+
7272 return usm::parseDisjointPoolConfig (PoolConfigVal, PoolTrace);
7373}
7474
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ constexpr auto operator""_GB(unsigned long long x) -> size_t {
2424 return x * 1024 * 1024 * 1024 ;
2525}
2626
27- DisjointPoolAllConfigs::DisjointPoolAllConfigs () {
27+ DisjointPoolAllConfigs::DisjointPoolAllConfigs (int trace ) {
2828 Configs[DisjointPoolMemType::Host].name = " Host" ;
2929 Configs[DisjointPoolMemType::Device].name = " Device" ;
3030 Configs[DisjointPoolMemType::Shared].name = " Shared" ;
@@ -58,6 +58,10 @@ DisjointPoolAllConfigs::DisjointPoolAllConfigs() {
5858 Configs[DisjointPoolMemType::SharedReadOnly].MaxPoolableSize = 4_MB;
5959 Configs[DisjointPoolMemType::SharedReadOnly].Capacity = 4 ;
6060 Configs[DisjointPoolMemType::SharedReadOnly].SlabMinSize = 2_MB;
61+
62+ for (auto &Config : Configs) {
63+ Config.PoolTrace = trace;
64+ }
6165}
6266
6367DisjointPoolAllConfigs parseDisjointPoolConfig (const std::string &config,
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class DisjointPoolAllConfigs {
2323 size_t EnableBuffers = 1 ;
2424 DisjointPoolConfig Configs[DisjointPoolMemType::All];
2525
26- DisjointPoolAllConfigs ();
26+ DisjointPoolAllConfigs (int trace = 0 );
2727};
2828
2929// Parse optional config parameters of this form:
You can’t perform that action at this time.
0 commit comments