@@ -19,8 +19,8 @@ class HeterogeneousSoA {
1919 HeterogeneousSoA (HeterogeneousSoA &&) = default ;
2020 HeterogeneousSoA &operator =(HeterogeneousSoA &&) = default ;
2121
22- explicit HeterogeneousSoA (cudautils ::device::unique_ptr<T> &&p) : dm_ptr(std::move(p)) {}
23- explicit HeterogeneousSoA (cudautils ::host::unique_ptr<T> &&p) : hm_ptr(std::move(p)) {}
22+ explicit HeterogeneousSoA (cms::cuda ::device::unique_ptr<T> &&p) : dm_ptr(std::move(p)) {}
23+ explicit HeterogeneousSoA (cms::cuda ::host::unique_ptr<T> &&p) : hm_ptr(std::move(p)) {}
2424 explicit HeterogeneousSoA (std::unique_ptr<T> &&p) : std_ptr(std::move(p)) {}
2525
2626 auto const *get () const { return dm_ptr ? dm_ptr.get () : (hm_ptr ? hm_ptr.get () : std_ptr.get ()); }
@@ -36,74 +36,74 @@ class HeterogeneousSoA {
3636 auto *operator -> () { return get (); }
3737
3838 // in reality valid only for GPU version...
39- cudautils ::host::unique_ptr<T> toHostAsync (cudaStream_t stream) const {
39+ cms::cuda ::host::unique_ptr<T> toHostAsync (cudaStream_t stream) const {
4040 assert (dm_ptr);
41- auto ret = cudautils ::make_host_unique<T>(stream);
41+ auto ret = cms::cuda ::make_host_unique<T>(stream);
4242 cudaCheck (cudaMemcpyAsync (ret.get (), dm_ptr.get (), sizeof (T), cudaMemcpyDefault, stream));
4343 return ret;
4444 }
4545
4646private:
4747 // a union wan't do it, a variant will not be more efficienct
48- cudautils ::device::unique_ptr<T> dm_ptr; // !
49- cudautils ::host::unique_ptr<T> hm_ptr; // !
48+ cms::cuda ::device::unique_ptr<T> dm_ptr; // !
49+ cms::cuda ::host::unique_ptr<T> hm_ptr; // !
5050 std::unique_ptr<T> std_ptr; // !
5151};
5252
5353namespace cudaCompat {
5454
5555 struct GPUTraits {
5656 template <typename T>
57- using unique_ptr = cudautils ::device::unique_ptr<T>;
57+ using unique_ptr = cms::cuda ::device::unique_ptr<T>;
5858
5959 template <typename T>
6060 static auto make_unique (cudaStream_t stream) {
61- return cudautils ::make_device_unique<T>(stream);
61+ return cms::cuda ::make_device_unique<T>(stream);
6262 }
6363
6464 template <typename T>
6565 static auto make_unique (size_t size, cudaStream_t stream) {
66- return cudautils ::make_device_unique<T>(size, stream);
66+ return cms::cuda ::make_device_unique<T>(size, stream);
6767 }
6868
6969 template <typename T>
7070 static auto make_host_unique (cudaStream_t stream) {
71- return cudautils ::make_host_unique<T>(stream);
71+ return cms::cuda ::make_host_unique<T>(stream);
7272 }
7373
7474 template <typename T>
7575 static auto make_device_unique (cudaStream_t stream) {
76- return cudautils ::make_device_unique<T>(stream);
76+ return cms::cuda ::make_device_unique<T>(stream);
7777 }
7878
7979 template <typename T>
8080 static auto make_device_unique (size_t size, cudaStream_t stream) {
81- return cudautils ::make_device_unique<T>(size, stream);
81+ return cms::cuda ::make_device_unique<T>(size, stream);
8282 }
8383 };
8484
8585 struct HostTraits {
8686 template <typename T>
87- using unique_ptr = cudautils ::host::unique_ptr<T>;
87+ using unique_ptr = cms::cuda ::host::unique_ptr<T>;
8888
8989 template <typename T>
9090 static auto make_unique (cudaStream_t stream) {
91- return cudautils ::make_host_unique<T>(stream);
91+ return cms::cuda ::make_host_unique<T>(stream);
9292 }
9393
9494 template <typename T>
9595 static auto make_host_unique (cudaStream_t stream) {
96- return cudautils ::make_host_unique<T>(stream);
96+ return cms::cuda ::make_host_unique<T>(stream);
9797 }
9898
9999 template <typename T>
100100 static auto make_device_unique (cudaStream_t stream) {
101- return cudautils ::make_device_unique<T>(stream);
101+ return cms::cuda ::make_device_unique<T>(stream);
102102 }
103103
104104 template <typename T>
105105 static auto make_device_unique (size_t size, cudaStream_t stream) {
106- return cudautils ::make_device_unique<T>(size, stream);
106+ return cms::cuda ::make_device_unique<T>(size, stream);
107107 }
108108 };
109109
@@ -158,7 +158,7 @@ class HeterogeneousSoAImpl {
158158
159159 T *get () { return m_ptr.get (); }
160160
161- cudautils ::host::unique_ptr<T> toHostAsync (cudaStream_t stream) const ;
161+ cms::cuda ::host::unique_ptr<T> toHostAsync (cudaStream_t stream) const ;
162162
163163private:
164164 unique_ptr<T> m_ptr; // !
@@ -171,8 +171,8 @@ HeterogeneousSoAImpl<T, Traits>::HeterogeneousSoAImpl(cudaStream_t stream) {
171171
172172// in reality valid only for GPU version...
173173template <typename T, typename Traits>
174- cudautils ::host::unique_ptr<T> HeterogeneousSoAImpl<T, Traits>::toHostAsync(cudaStream_t stream) const {
175- auto ret = cudautils ::make_host_unique<T>(stream);
174+ cms::cuda ::host::unique_ptr<T> HeterogeneousSoAImpl<T, Traits>::toHostAsync(cudaStream_t stream) const {
175+ auto ret = cms::cuda ::make_host_unique<T>(stream);
176176 cudaCheck (cudaMemcpyAsync (ret.get (), get (), sizeof (T), cudaMemcpyDefault, stream));
177177 return ret;
178178}
0 commit comments