Skip to content

Commit

Permalink
Remove misplaced and commented host lock array code in OpenMPTarget b…
Browse files Browse the repository at this point in the history
…ackend
  • Loading branch information
dalg24 committed Feb 27, 2023
1 parent 63879db commit cba99e8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 64 deletions.
33 changes: 0 additions & 33 deletions core/src/OpenMPTarget/Kokkos_OpenMPTargetSpace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,39 +165,6 @@ SharedAllocationRecord<Kokkos::Experimental::OpenMPTargetSpace, void>::
} // namespace Impl
} // namespace Kokkos

/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
/*
namespace Kokkos {
namespace {
const unsigned HOST_SPACE_ATOMIC_MASK = 0xFFFF;
const unsigned HOST_SPACE_ATOMIC_XOR_MASK = 0x5A39;
static int HOST_SPACE_ATOMIC_LOCKS[HOST_SPACE_ATOMIC_MASK+1];
}
namespace Impl {
void init_lock_array_host_space() {
static int is_initialized = 0;
if(! is_initialized)
for(int i = 0; i < static_cast<int> (HOST_SPACE_ATOMIC_MASK+1); i++)
HOST_SPACE_ATOMIC_LOCKS[i] = 0;
}
bool lock_address_host_space(void* ptr) {
return 0 == atomic_compare_exchange( &HOST_SPACE_ATOMIC_LOCKS[
(( size_t(ptr) >> 2 ) & HOST_SPACE_ATOMIC_MASK) ^
HOST_SPACE_ATOMIC_XOR_MASK] , 0 , 1);
}
void unlock_address_host_space(void* ptr) {
atomic_exchange( &HOST_SPACE_ATOMIC_LOCKS[
(( size_t(ptr) >> 2 ) & HOST_SPACE_ATOMIC_MASK) ^
HOST_SPACE_ATOMIC_XOR_MASK] , 0);
}
}
}*/

//==============================================================================
// <editor-fold desc="Explicit instantiations of CRTP Base classes"> {{{1

Expand Down
31 changes: 0 additions & 31 deletions core/src/OpenMPTarget/Kokkos_OpenMPTargetSpace.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,37 +35,6 @@ static_assert(false,
#include <Kokkos_HostSpace.hpp>
#include <omp.h>

/*--------------------------------------------------------------------------*/

namespace Kokkos {
namespace Impl {

/// \brief Initialize lock array for arbitrary size atomics.
///
/// Arbitrary atomics are implemented using a hash table of locks
/// where the hash value is derived from the address of the
/// object for which an atomic operation is performed.
/// This function initializes the locks to zero (unset).
// void init_lock_array_host_space();

/// \brief Acquire a lock for the address
///
/// This function tries to acquire the lock for the hash value derived
/// from the provided ptr. If the lock is successfully acquired the
/// function returns true. Otherwise it returns false.
// bool lock_address_host_space(void* ptr);

/// \brief Release lock for the address
///
/// This function releases the lock for the hash value derived
/// from the provided ptr. This function should only be called
/// after previously successfully acquiring a lock with
/// lock_address.
// void unlock_address_host_space(void* ptr);

} // namespace Impl
} // namespace Kokkos

namespace Kokkos {
namespace Impl {

Expand Down

0 comments on commit cba99e8

Please sign in to comment.