File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
core/conversion/conversionctx Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -124,13 +124,13 @@ ConversionCtx::ConversionCtx(BuilderSettings build_settings)
124
124
settings.enabled_precisions .find (nvinfer1::DataType::kFLOAT ) == settings.enabled_precisions .end (),
125
125
" DLA supports only fp16 or int8 precision" );
126
126
cfg->setDLACore (settings.device .dla_core );
127
- if (settings.dla_sram_size != 1048576 ) {
127
+ if (settings.dla_sram_size != DLA_SRAM_SIZE ) {
128
128
cfg->setMemoryPoolLimit (nvinfer1::MemoryPoolType::kDLA_MANAGED_SRAM , settings.dla_sram_size );
129
129
}
130
- if (settings.dla_local_dram_size != 1073741824 ) {
130
+ if (settings.dla_local_dram_size != DLA_LOCAL_DRAM_SIZE ) {
131
131
cfg->setMemoryPoolLimit (nvinfer1::MemoryPoolType::kDLA_LOCAL_DRAM , settings.dla_local_dram_size );
132
132
}
133
- if (settings.dla_global_dram_size != 536870912 ) {
133
+ if (settings.dla_global_dram_size != DLA_GLOBAL_DRAM_SIZE ) {
134
134
cfg->setMemoryPoolLimit (nvinfer1::MemoryPoolType::kDLA_GLOBAL_DRAM , settings.dla_global_dram_size );
135
135
}
136
136
}
Original file line number Diff line number Diff line change 11
11
#include < cuda_runtime.h>
12
12
#include " core/util/prelude.h"
13
13
14
+ #define DLA_SRAM_SIZE 1048576
15
+ #define DLA_LOCAL_DRAM_SIZE 1073741824
16
+ #define DLA_GLOBAL_DRAM_SIZE 536870912
17
+
14
18
namespace torch_tensorrt {
15
19
namespace core {
16
20
namespace conversion {
@@ -35,9 +39,9 @@ struct BuilderSettings {
35
39
nvinfer1::IInt8Calibrator* calibrator = nullptr ;
36
40
uint64_t num_avg_timing_iters = 1 ;
37
41
uint64_t workspace_size = 0 ;
38
- uint64_t dla_sram_size = 1048576 ;
39
- uint64_t dla_local_dram_size = 1073741824 ;
40
- uint64_t dla_global_dram_size = 536870912 ;
42
+ uint64_t dla_sram_size = DLA_SRAM_SIZE ;
43
+ uint64_t dla_local_dram_size = DLA_LOCAL_DRAM_SIZE ;
44
+ uint64_t dla_global_dram_size = DLA_GLOBAL_DRAM_SIZE ;
41
45
42
46
BuilderSettings () = default ;
43
47
BuilderSettings (const BuilderSettings& other) = default ;
You can’t perform that action at this time.
0 commit comments