Skip to content

Commit d932859

Browse files
authored
Merge branch 'develop' into reduceLoops
2 parents 29c9795 + 25fd008 commit d932859

10 files changed

+1
-123
lines changed

RELEASE_NOTES.md

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ The format of this file is based on [Keep a Changelog](http://keepachangelog.com
2525
- Removed Accessor template parameter from host\_device\_ptr.
2626
- Removed NoOpAccessor and RaceConditionAccessor. It is recommended to use ThreadSanitizer (TSAN) instead to locate race conditions.
2727
- Removed CARE\_ENABLE\_RACE\_DETECTION configuration option.
28+
- Removed implicit conversions between raw pointers and host\_device\_ptrs/host\_ptrs and the corresponding CARE\_ENABLE\_IMPLICIT\_CONVERSIONS configuration option.
2829

2930
### Changed
3031
- Renamed host\_device\_ptr::getPointer to host\_device\_ptr::data.

cmake/SetupOptions.cmake

-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ option(ENABLE_PICK "Enable pick and set methods on ManagedArrays" ON)
1414
option(ENABLE_PINNED "Enable pinned memory space" ON)
1515
option(CARE_ENABLE_PINNED_MEMORY_FOR_SCANS "Use pinned memory for scan lengths" ON)
1616
option(CARE_GPU_MEMORY_IS_ACCESSIBLE_ON_CPU "Allows default memory spaces for ZERO_COPY and PAGEABLE to be the GPU memory space" OFF)
17-
# Option to disable implicit conversion between host_device_ptr and raw arrays in CARE.
18-
option(CARE_ENABLE_IMPLICIT_CONVERSIONS "Enable implicit conversions to-from raw pointers" ON)
19-
# CHAI must also be configured with the same settings for implicit conversions.
20-
set(CHAI_ENABLE_IMPLICIT_CONVERSIONS ${CARE_ENABLE_IMPLICIT_CONVERSIONS} CACHE BOOL "Enable implicit conversions to-from raw pointers")
2117
option(CARE_LEGACY_COMPATIBILITY_MODE "Enable legacy compatibility mode" OFF)
2218
option(CARE_DEEP_COPY_RAW_PTR "Use deep copy for managed array initialization from raw pointer" OFF)
2319
option(CARE_ENABLE_MANAGED_PTR "Enable managed_ptr aliases, tests, and reproducer" ON)

configs/lc/toss_4_x86_64_ib_cray/amdclang.cmake

-2
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,3 @@ set(ENABLE_HIP ON CACHE BOOL "Enable Hip")
1313
set(ROCM_PATH "/usr/tce/packages/rocmcc/rocmcc-6.1.0-magic" CACHE PATH "")
1414
set(CMAKE_HIP_ARCHITECTURES "gfx942:xnack+" CACHE STRING "")
1515
set(AMDGPU_TARGETS "gfx942:xnack+" CACHE STRING "")
16-
17-
set(CARE_ENABLE_IMPLICIT_CONVERSIONS OFF CACHE BOOL "Enable implicit conversions")

src/care/KeyValueSorter_decl.h

-51
Original file line numberDiff line numberDiff line change
@@ -174,31 +174,6 @@ class CARE_DLL_API KeyValueSorter<KeyType, ValueType, RAJADeviceExec> {
174174
setKeyValueArraysFromManagedArray(m_keys, m_values, len, arr);
175175
}
176176

177-
#if defined(CARE_ENABLE_IMPLICIT_CONVERSIONS)
178-
179-
///////////////////////////////////////////////////////////////////////////
180-
/// @author Alan Dayton
181-
///
182-
/// @brief Constructor
183-
///
184-
/// Allocates space and initializes the KeyValueSorter by copying
185-
/// elements and ordering from the given managed array
186-
///
187-
/// @note This overload is needed to prevent ambiguity when implicit
188-
/// casts are enabled
189-
///
190-
/// @param[in] len - The number of elements to allocate space for
191-
/// @param[in] arr - The managed array to copy elements from
192-
///
193-
/// @return a KeyValueSorter instance
194-
///////////////////////////////////////////////////////////////////////////
195-
KeyValueSorter<KeyType, ValueType, RAJADeviceExec>(const size_t len, const host_device_ptr<ValueType> & arr)
196-
: KeyValueSorter<KeyType, ValueType, RAJADeviceExec>(len, host_device_ptr<const ValueType>(arr))
197-
{
198-
}
199-
200-
#endif // defined(CARE_ENABLE_IMPLICIT_CONVERSIONS)
201-
202177
///////////////////////////////////////////////////////////////////////////
203178
/// @author Alan Dayton
204179
/// @brief (Shallow) Copy constructor
@@ -758,32 +733,6 @@ class CARE_DLL_API KeyValueSorter<KeyType, ValueType, RAJA::seq_exec> {
758733
setKeyValueArraysFromManagedArray(m_keyValues, len, arr);
759734
}
760735

761-
#if defined(CARE_ENABLE_IMPLICIT_CONVERSIONS)
762-
763-
///////////////////////////////////////////////////////////////////////////
764-
/// @author Alan Dayton
765-
///
766-
/// @brief Constructor
767-
///
768-
/// Allocates space and initializes the KeyValueSorter by copying
769-
/// elements and ordering from the given managed array
770-
///
771-
/// @note This overload is needed to prevent ambiguity when implicit
772-
/// casts are enabled
773-
///
774-
/// @param[in] len - The number of elements to allocate space for
775-
/// @param[in] arr - The managed array to copy elements from
776-
///
777-
/// @return a KeyValueSorter instance
778-
///
779-
///////////////////////////////////////////////////////////////////////////
780-
KeyValueSorter<KeyType, ValueType, RAJA::seq_exec>(const size_t len, const host_device_ptr<ValueType> & arr)
781-
: KeyValueSorter<KeyType, ValueType, RAJA::seq_exec>(len, host_device_ptr<const ValueType>(arr))
782-
{
783-
}
784-
785-
#endif // defined(CARE_ENABLE_IMPLICIT_CONVERSIONS)
786-
787736
///////////////////////////////////////////////////////////////////////////
788737
/// @author Alan Dayton
789738
/// @brief (Shallow) Copy constructor

src/care/algorithm_decl.h

-10
Original file line numberDiff line numberDiff line change
@@ -250,16 +250,6 @@ CARE_HOST_DEVICE bool checkSorted(const care::host_device_ptr<const T>& array, c
250250
const bool allowDuplicates = false,
251251
const bool warnOnFailure = true);
252252

253-
#if defined(CARE_ENABLE_IMPLICIT_CONVERSIONS)
254-
255-
template <typename T>
256-
CARE_HOST_DEVICE bool checkSorted(const care::host_device_ptr<T>& array, const int len,
257-
const char* name, const char* argname,
258-
const bool allowDuplicates = false,
259-
const bool warnOnFailure = true);
260-
261-
#endif // defined(CARE_ENABLE_IMPLICIT_CONVERSIONS)
262-
263253
template<typename mapType>
264254
CARE_HOST_DEVICE CARE_DLL_API int BinarySearch(const mapType *map,
265255
const int start,

src/care/algorithm_impl.h

-15
Original file line numberDiff line numberDiff line change
@@ -103,21 +103,6 @@ CARE_HOST_DEVICE CARE_INLINE bool checkSorted(const care::host_device_ptr<const
103103
return checkSorted<T>(array.data(), len, name, argname, allowDuplicates, warnOnFailure);
104104
}
105105

106-
#if defined(CARE_ENABLE_IMPLICIT_CONVERSIONS)
107-
108-
template <typename T>
109-
CARE_HOST_DEVICE CARE_INLINE bool checkSorted(const care::host_device_ptr<T>& array,
110-
const int len,
111-
const char* name,
112-
const char* argname,
113-
const bool allowDuplicates,
114-
const bool warnOnFailure)
115-
{
116-
return checkSorted(care::host_device_ptr<const T>(array), len, name, argname, allowDuplicates, warnOnFailure);
117-
}
118-
119-
#endif // defined(CARE_ENABLE_IMPLICIT_CONVERSIONS)
120-
121106
/************************************************************************
122107
* Function : IntersectArrays<A,RAJAExec>
123108
* Author(s) : Peter Robinson, based on IntersectGlobalIDArrays by Al Nichols

src/care/care_inst.h

-15
Original file line numberDiff line numberDiff line change
@@ -100,21 +100,6 @@ CARE_EXTERN template CARE_DLL_API
100100
CARE_HOST_DEVICE bool checkSorted(const care::host_device_ptr<const globalID>&, const int, const char*, const char*, const bool, const bool) ;
101101
#endif
102102

103-
#if defined(CARE_ENABLE_IMPLICIT_CONVERSIONS)
104-
105-
CARE_EXTERN template CARE_DLL_API
106-
CARE_HOST_DEVICE bool checkSorted(const care::host_device_ptr<int>&, const int, const char*, const char*, const bool, const bool) ;
107-
CARE_EXTERN template CARE_DLL_API
108-
CARE_HOST_DEVICE bool checkSorted(const care::host_device_ptr<float>&, const int, const char*, const char*, const bool, const bool) ;
109-
CARE_EXTERN template CARE_DLL_API
110-
CARE_HOST_DEVICE bool checkSorted(const care::host_device_ptr<double>&, const int, const char*, const char*, const bool, const bool) ;
111-
#if CARE_HAVE_LLNL_GLOBALID
112-
CARE_EXTERN template CARE_DLL_API
113-
CARE_HOST_DEVICE bool checkSorted(const care::host_device_ptr<globalID>&, const int, const char*, const char*, const bool, const bool) ;
114-
#endif
115-
116-
#endif // defined(CARE_ENABLE_IMPLICIT_CONVERSIONS)
117-
118103
///////////////////////////////////////////////////////////////////////////////
119104

120105
#ifdef CARE_PARALLEL_DEVICE

src/care/config.h.in

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#cmakedefine CARE_ENABLE_BOUNDS_CHECKING
1616
#cmakedefine01 CARE_ENABLE_GPU_SIMULATION_MODE
1717
#cmakedefine CARE_NEVER_USE_RAJA_PARALLEL_SCAN
18-
#cmakedefine CARE_ENABLE_IMPLICIT_CONVERSIONS
1918
#ifndef CARE_LEGACY_COMPATIBILITY_MODE
2019
#cmakedefine01 CARE_LEGACY_COMPATIBILITY_MODE
2120
#endif

src/care/host_device_ptr.h

-16
Original file line numberDiff line numberDiff line change
@@ -97,22 +97,6 @@ namespace care {
9797
///
9898
CARE_HOST_DEVICE host_device_ptr<T>(std::nullptr_t from) noexcept : MA (from) {}
9999

100-
#if defined(CARE_ENABLE_IMPLICIT_CONVERSIONS)
101-
///
102-
/// @author Peter Robinson
103-
///
104-
/// Construct from a raw pointer
105-
///
106-
/// @note Only safe if the raw pointer is already registered with CHAI
107-
///
108-
template <bool Q = 0>
109-
CARE_HOST_DEVICE host_device_ptr<T>(
110-
T * from, //!< Raw pointer to construct from
111-
chai::CHAIDISAMBIGUATE name=chai::CHAIDISAMBIGUATE(), //!< Used to disambiguate this constructor
112-
bool foo=Q) //!< Used to disambiguate this constructor
113-
: MA(from, name, foo) {}
114-
#endif
115-
116100
///
117101
/// @author Peter Robinson
118102
///

src/care/host_ptr.h

-9
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,6 @@ namespace care {
123123
return m_ptr[index];
124124
}
125125

126-
#if defined(CARE_ENABLE_IMPLICIT_CONVERSIONS)
127-
///
128-
/// @author Peter Robinson
129-
///
130-
/// Convert to a raw pointer
131-
///
132-
operator T*() const { return m_ptr; }
133-
#endif
134-
135126
///
136127
/// @author Peter Robinson
137128
///

0 commit comments

Comments
 (0)