Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Use int instead of OffsetT
Browse files Browse the repository at this point in the history
  • Loading branch information
gevtushenko committed Oct 15, 2021
1 parent c9ea550 commit 07cf600
Show file tree
Hide file tree
Showing 5 changed files with 283 additions and 380 deletions.
16 changes: 8 additions & 8 deletions cub/detail/temporary_storage.cuh
Expand Up @@ -132,7 +132,7 @@ class alias
: m_slot(slot)
, m_elements(elements)
{
update_slot();
this->update_slot();
}

__host__ __device__ void update_slot()
Expand All @@ -156,7 +156,7 @@ public:
__host__ __device__ void grow(std::size_t new_elements)
{
m_elements = new_elements;
update_slot();
this->update_slot();
}

/**
Expand Down Expand Up @@ -250,7 +250,7 @@ class layout
slot m_slots[SlotsCount];
std::size_t m_sizes[SlotsCount];
void *m_pointers[SlotsCount];
bool layout_was_mapped {};
bool m_layout_was_mapped {};

public:
layout() = default;
Expand All @@ -270,7 +270,7 @@ public:
*/
__host__ __device__ std::size_t get_size()
{
prepare_interface();
this->prepare_interface();

// AliasTemporaries can return error only in mapping stage,
// so it's safe to ignore it here.
Expand Down Expand Up @@ -300,12 +300,12 @@ public:
__host__ __device__ cudaError_t map_to_buffer(void *d_temp_storage,
std::size_t temp_storage_bytes)
{
if (layout_was_mapped)
if (m_layout_was_mapped)
{
return cudaErrorAlreadyMapped;
}

prepare_interface();
this->prepare_interface();

cudaError_t error = cudaSuccess;
if ((error = AliasTemporaries(d_temp_storage,
Expand All @@ -321,14 +321,14 @@ public:
m_slots[slot_id].set_storage(m_pointers[slot_id]);
}

layout_was_mapped = true;
m_layout_was_mapped = true;
return error;
}

private:
__host__ __device__ void prepare_interface()
{
if (layout_was_mapped)
if (m_layout_was_mapped)
{
return;
}
Expand Down

0 comments on commit 07cf600

Please sign in to comment.