Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit 0899ee1

Browse files
author
Jules Pondard
committed
Add shared_memory_size function to PyBinds
This function might be useful in the future for compilation options search. One of the available options allows us to set the maximum shared memory used.
1 parent 7bdb6bc commit 0899ee1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tensor_comprehensions/pybinds/tclib.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "tc/aten/aten_autotuner.h"
3131
#include "tc/autotuner/genetic_search.h"
3232
#include "tc/autotuner/options_cache.h"
33+
#include "tc/core/cuda/cuda.h"
3334
#include "tc/core/cuda/cuda_backend.h"
3435
#include "tc/core/cuda/cuda_tc_executor.h"
3536
#include "tc/core/flags.h"
@@ -447,6 +448,11 @@ PYBIND11_MODULE(tclib, m) {
447448
return res;
448449
});
449450

451+
// Get GPU shared memory size
452+
m.def("shared_memory_size", []() {
453+
return CudaGPUInfo::GPUInfo().SharedMemorySize();
454+
});
455+
450456
// Low-level stateful API compile returns an executor on which run and
451457
// unchecked_run can be called.
452458
py::class_<TcExecutor>(m, "TcExecutor")

0 commit comments

Comments
 (0)