88// granted to it by virtue of its status as an Intergovernmental Organization
99// or submit itself to any jurisdiction.
1010// /
11- // / \file UtilsHIP .hip.cxx
11+ // / \file utilsHIP .hip.cxx
1212// / \brief
1313// /
1414
@@ -58,7 +58,7 @@ namespace its
5858namespace gpu
5959{
6060
61- void Utils::HostHIP ::checkHIPError (const hipError_t error, const char * file, const int line)
61+ void utils::host_hip ::checkHIPError (const hipError_t error, const char * file, const int line)
6262{
6363 if (error != hipSuccess) {
6464 std::ostringstream errorString{};
@@ -68,18 +68,18 @@ void Utils::HostHIP::checkHIPError(const hipError_t error, const char* file, con
6868 }
6969}
7070
71- dim3 Utils::HostHIP ::getBlockSize (const int colsNum)
71+ dim3 utils::host_hip ::getBlockSize (const int colsNum)
7272{
7373 return getBlockSize (colsNum, 1 );
7474}
7575
76- dim3 Utils::HostHIP ::getBlockSize (const int colsNum, const int rowsNum)
76+ dim3 utils::host_hip ::getBlockSize (const int colsNum, const int rowsNum)
7777{
7878 const DeviceProperties& deviceProperties = ContextHIP::getInstance ().getDeviceProperties ();
7979 return getBlockSize (colsNum, rowsNum, deviceProperties.streamProcessors / deviceProperties.maxBlocksPerSM );
8080}
8181
82- dim3 Utils::HostHIP ::getBlockSize (const int colsNum, const int rowsNum, const int maxThreadsPerBlock)
82+ dim3 utils::host_hip ::getBlockSize (const int colsNum, const int rowsNum, const int maxThreadsPerBlock)
8383{
8484 const DeviceProperties& deviceProperties = ContextHIP::getInstance ().getDeviceProperties ();
8585 int xThreads = std::max (std::min (colsNum, static_cast <int >(deviceProperties.maxThreadsDim .x )), 1 );
@@ -98,71 +98,71 @@ dim3 Utils::HostHIP::getBlockSize(const int colsNum, const int rowsNum, const in
9898 return dim3{static_cast <unsigned int >(xThreads), static_cast <unsigned int >(yThreads)};
9999}
100100
101- dim3 Utils::HostHIP ::getBlocksGrid (const dim3& threadsPerBlock, const int rowsNum)
101+ dim3 utils::host_hip ::getBlocksGrid (const dim3& threadsPerBlock, const int rowsNum)
102102{
103103 return getBlocksGrid (threadsPerBlock, rowsNum, 1 );
104104}
105105
106- dim3 Utils::HostHIP ::getBlocksGrid (const dim3& threadsPerBlock, const int rowsNum, const int colsNum)
106+ dim3 utils::host_hip ::getBlocksGrid (const dim3& threadsPerBlock, const int rowsNum, const int colsNum)
107107{
108108 return dim3{1 + (rowsNum - 1 ) / threadsPerBlock.x , 1 + (colsNum - 1 ) / threadsPerBlock.y };
109109}
110110
111- void Utils::HostHIP ::gpuMalloc (void ** p, const int size)
111+ void utils::host_hip ::gpuMalloc (void ** p, const int size)
112112{
113113 checkHIPError (hipMalloc (p, size), __FILE__, __LINE__);
114114}
115115
116- void Utils::HostHIP ::gpuFree (void * p)
116+ void utils::host_hip ::gpuFree (void * p)
117117{
118118 checkHIPError (hipFree (p), __FILE__, __LINE__);
119119}
120120
121- void Utils::HostHIP ::gpuMemset (void * p, int value, int size)
121+ void utils::host_hip ::gpuMemset (void * p, int value, int size)
122122{
123123 checkHIPError (hipMemset (p, value, size), __FILE__, __LINE__);
124124}
125125
126- void Utils::HostHIP ::gpuMemcpyHostToDevice (void * dst, const void * src, int size)
126+ void utils::host_hip ::gpuMemcpyHostToDevice (void * dst, const void * src, int size)
127127{
128128 checkHIPError (hipMemcpy (dst, src, size, hipMemcpyHostToDevice), __FILE__, __LINE__);
129129}
130130
131- void Utils::HostHIP ::gpuMemcpyHostToDeviceAsync (void * dst, const void * src, int size, hipStream_t& stream)
131+ void utils::host_hip ::gpuMemcpyHostToDeviceAsync (void * dst, const void * src, int size, hipStream_t& stream)
132132{
133133 checkHIPError (hipMemcpyAsync (dst, src, size, hipMemcpyHostToDevice, stream), __FILE__, __LINE__);
134134}
135135
136- void Utils::HostHIP ::gpuMemcpyDeviceToHost (void * dst, const void * src, int size)
136+ void utils::host_hip ::gpuMemcpyDeviceToHost (void * dst, const void * src, int size)
137137{
138138 checkHIPError (hipMemcpy (dst, src, size, hipMemcpyDeviceToHost), __FILE__, __LINE__);
139139}
140140
141- // void Utils::HostHIP ::gpuStartProfiler()
141+ // void utils::host_hip ::gpuStartProfiler()
142142// {
143143// checkHIPError(hipProfilerStart(), __FILE__, __LINE__);
144144// }
145145
146- // void Utils::HostHIP ::gpuStopProfiler()
146+ // void utils::host_hip ::gpuStopProfiler()
147147// {
148148// checkHIPError(hipProfilerStop(), __FILE__, __LINE__);
149149// }
150150
151- GPUd () int Utils::DeviceHIP ::getLaneIndex ()
151+ GPUd () int utils::device_hip ::getLaneIndex ()
152152{
153153 uint32_t laneIndex;
154154 asm volatile (" mov.u32 %0, %%laneid;"
155155 : " =r" (laneIndex));
156156 return static_cast <int >(laneIndex);
157157}
158158
159- // GPUd() int Utils ::Device::shareToWarp(const int value, const int laneIndex)
159+ // GPUd() int utils ::Device::shareToWarp(const int value, const int laneIndex)
160160// {
161161// cooperative_groups::coalesced_group threadGroup = cooperative_groups::coalesced_threads();
162162// return threadGroup.shfl(value, laneIndex);
163163// }
164164
165- // GPUd() int Utils ::Device::gpuAtomicAdd(int* p, const int incrementSize)
165+ // GPUd() int utils ::Device::gpuAtomicAdd(int* p, const int incrementSize)
166166// {
167167// return atomicAdd(p, incrementSize);
168168// }
0 commit comments