Update thrust system hip headers
MODIFY
thrust/system/hip/config.h
thrust/system/hip/config.h
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer.
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.

MODIFY
thrust/system/hip/error.h
thrust/system/hip/error.h
@@ -188,4 +188,3 @@ using system::hip_category;
} // end namespace thrust
#include <thrust/system/hip/detail/error.inl>
-

MODIFY
thrust/system/hip/memory.h
thrust/system/hip/memory.h
#include <hip/hip_runtime.h>
+#include <ostream>
+#include <thrust/detail/allocator/malloc_allocator.h>
#include <thrust/detail/config.h>
-#include <thrust/system/hip/execution_policy.h>
-#include <thrust/memory.h>
#include <thrust/detail/type_traits.h>
-#include <thrust/detail/allocator/malloc_allocator.h>
-#include <ostream>
+#include <thrust/memory.h>
+#include <thrust/system/hip/execution_policy.h>
BEGIN_NS_THRUST
-namespace hip_rocprim {
+namespace hip_rocprim
+{
template <typename>
class pointer;
@@ -39,7 +40,6 @@ class pointer;
} // end hip_rocprim
END_NS_THRUST
-
// specialize thrust::iterator_traits to avoid problems with the name of
// pointer's constructor shadowing its nested pointer type
// do this before pointer is defined so the specialization is correctly
@@ -60,7 +60,8 @@ public:
typedef typename ptr::reference reference;
}; // end iterator_traits
-namespace hip_rocprim {
+namespace hip_rocprim
+{
// forward declaration of reference for pointer
template <typename Element>
@@ -75,72 +76,65 @@ class reference;
// typedef thrust::hip_rocprim::reference<Element> type;
// }; // end reference_msvc_workaround
-
template <typename T>
-class pointer
- : public thrust::pointer<
- T,
+class pointer : public thrust::pointer<T,
thrust::hip_rocprim::tag,
thrust::hip_rocprim::reference<T>,
thrust::hip_rocprim::pointer<T>>
{
private:
- typedef thrust::pointer<
- T,
+ typedef thrust::pointer<T,
thrust::hip_rocprim::tag,
typename reference_msvc_workaround<T>::type,
thrust::hip_rocprim::pointer<T>>
super_t;
public:
- __host__ __device__
- pointer() : super_t() {}
+ __host__ __device__ pointer()
+ : super_t()
+ {
+ }
template <typename OtherT>
- __host__ __device__ explicit pointer(OtherT *ptr) : super_t(ptr)
+ __host__ __device__ explicit pointer(OtherT* ptr)
+ : super_t(ptr)
{
}
// STREAMHPC Fixes HCC linkage error
- __host__ __device__
- explicit pointer(T *ptr) : super_t(ptr) {}
+ __host__ __device__ explicit pointer(T* ptr)
+ : super_t(ptr)
+ {
+ }
template <typename OtherPointer>
__host__ __device__
pointer(const OtherPointer& other,
- typename thrust::detail::enable_if_pointer_is_convertible<
- OtherPointer,
- pointer>::type * = 0) : super_t(other)
+ typename thrust::detail::enable_if_pointer_is_convertible<OtherPointer,
+ pointer>::type* = 0)
+ : super_t(other)
{
}
template <typename OtherPointer>
- __host__ __device__
- typename thrust::detail::enable_if_pointer_is_convertible<
- OtherPointer,
- pointer,
- pointer &>::type
+ __host__ __device__ typename thrust::detail::
+ enable_if_pointer_is_convertible<OtherPointer, pointer, pointer&>::type
operator=(const OtherPointer& other)
{
return super_t::operator=(other);
}
}; // struct pointer
-
template <typename T>
-class reference
- : public thrust::reference<
- T,
+class reference : public thrust::reference<T,
thrust::hip_rocprim::pointer<T>,
thrust::hip_rocprim::reference<T>>
{
private:
- typedef thrust::reference<
- T,
- thrust::hip_rocprim::pointer<T>,
- thrust::hip_rocprim::reference<T> >
+ typedef thrust::
+ reference<T, thrust::hip_rocprim::pointer<T>, thrust::hip_rocprim::reference<T>>
super_t;
public:
@@ -153,35 +147,26 @@ public:
}
template <typename OtherT>
- __host__ __device__
- reference(const reference<OtherT> &other,
- typename thrust::detail::enable_if_convertible<
- typename reference<OtherT>::pointer,
+ __host__ __device__ reference(
+ const reference<OtherT>& other,
+ typename thrust::detail::enable_if_convertible<typename reference<OtherT>::pointer,
pointer>::type* = 0)
: super_t(other)
{
}
template <typename OtherT>
- __host__ __device__
- reference &
- operator=(const reference<OtherT> &other);
+ __host__ __device__ reference& operator=(const reference<OtherT>& other);
- __host__ __device__
- reference &
- operator=(const value_type &x);
+ __host__ __device__ reference& operator=(const value_type& x);
}; // struct reference
template <typename T>
__host__ __device__ void swap(reference<T> x, reference<T> y);
-inline __host__ __device__
- pointer<void>
- malloc(std::size_t n);
+inline __host__ __device__ pointer<void> malloc(std::size_t n);
template <typename T>
-inline __host__ __device__
- pointer<T>
- malloc(std::size_t n);
+inline __host__ __device__ pointer<T> malloc(std::size_t n);
inline __host__ __device__ void free(pointer<void> ptr);
@@ -190,11 +175,7 @@ inline __host__ __device__ void free(pointer<void> ptr);
// thrust::detail::malloc_allocator<T,tag,pointer<T> >;
//
template <typename T>
-struct allocator
- : thrust::detail::malloc_allocator<
- T,
- tag,
- pointer<T> >
+struct allocator : thrust::detail::malloc_allocator<T, tag, pointer<T>>
{
template <typename U>
struct rebind
@@ -206,7 +187,8 @@ struct allocator
__host__ __device__ inline allocator(const allocator&)
: thrust::detail::malloc_allocator<T, tag, thrust::hip_rocprim::pointer<T>>()
- {}
+ {
+ }
template <typename U>
__host__ __device__ inline allocator(const allocator<U>&)
@@ -218,26 +200,28 @@ struct allocator
} // namespace hip_rocprim
-namespace system {
-namespace hip {
+namespace system
+{
+namespace hip
+{
+ using thrust::hip_rocprim::allocator;
+ using thrust::hip_rocprim::free;
+ using thrust::hip_rocprim::malloc;
using thrust::hip_rocprim::pointer;
using thrust::hip_rocprim::reference;
using thrust::hip_rocprim::swap;
-using thrust::hip_rocprim::malloc;
-using thrust::hip_rocprim::free;
-using thrust::hip_rocprim::allocator;
} // namespace hip
} /// namespace system
-namespace hip {
+namespace hip
+{
+ using thrust::hip_rocprim::allocator;
+ using thrust::hip_rocprim::free;
+ using thrust::hip_rocprim::malloc;
using thrust::hip_rocprim::pointer;
using thrust::hip_rocprim::reference;
-using thrust::hip_rocprim::malloc;
-using thrust::hip_rocprim::free;
-using thrust::hip_rocprim::allocator;
} // end hip
END_NS_THRUST
#include <thrust/system/hip/detail/memory.inl>
-

Update thrust system hip headers