SWDEV-351969 - TLS Optimization

- Aggregate all TLS(Thread Local Storage) variables into a single class
- This is to improve cache accesses per thread

Change-Id: Ic8361eaeae290fff00254684e309471958365eb9
这个提交包含在:
Rakesh Roy 编写, Rakesh Roy 于 2022-10-09 22:08:14 -04:00 提交
1 父节点 f83ba8cd23
当前提交 8b391ef18c
9 个文件已更改
+145 -115

没有与搜索条件相匹配的文件

+4 -5
查看文件
@@ -29,7 +29,6 @@
constexpr unsigned __hipFatMAGIC2 = 0x48495046; // "HIPF"
thread_local std::stack<ihipExec_t> execStack_;
PlatformState* PlatformState::platform_; // Initiaized as nullptr by default
// forward declaration of methods required for __hipRegisrterManagedVar
@@ -920,7 +919,7 @@ hipError_t PlatformState::initStatManagedVarDevicePtr(int deviceId) {
}
void PlatformState::setupArgument(const void* arg, size_t size, size_t offset) {
auto& arguments = execStack_.top().arguments_;
auto& arguments = hip::tls.exec_stack_.top().arguments_;
if (arguments.size() < offset + size) {
arguments.resize(offset + size);
@@ -931,10 +930,10 @@ void PlatformState::setupArgument(const void* arg, size_t size, size_t offset) {
void PlatformState::configureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem,
hipStream_t stream) {
execStack_.push(ihipExec_t{gridDim, blockDim, sharedMem, stream});
hip::tls.exec_stack_.push(ihipExec_t{gridDim, blockDim, sharedMem, stream});
}
void PlatformState::popExec(ihipExec_t& exec) {
exec = std::move(execStack_.top());
execStack_.pop();
exec = std::move(hip::tls.exec_stack_.top());
hip::tls.exec_stack_.pop();
}