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

Commit f0ed227

Browse files
committed
- Fix for linux compilation error in block-reduce-raking-commutative for
non-POD types - Fix for runtime out-of-memory error during quick sorting tests Former-commit-id: 1c06a94
1 parent 2b6380c commit f0ed227

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

cub/block/block_raking_layout.cuh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ struct BlockRakingLayout
104104
/**
105105
* \brief Shared memory storage type
106106
*/
107-
typedef T TempStorage[BlockRakingLayout::GRID_ELEMENTS];
107+
typedef T _TempStorage[BlockRakingLayout::GRID_ELEMENTS];
108+
109+
/// Alias wrapper allowing storage to be unioned
110+
struct TempStorage : Uninitialized<_TempStorage> {};
108111

109112

110113
/**
@@ -124,7 +127,7 @@ struct BlockRakingLayout
124127
}
125128

126129
// Incorporating a block of padding partials every shared memory segment
127-
return temp_storage + offset;
130+
return temp_storage.Alias() + offset;
128131
}
129132

130133

@@ -135,7 +138,7 @@ struct BlockRakingLayout
135138
TempStorage &temp_storage,
136139
int linear_tid)
137140
{
138-
return temp_storage + (linear_tid * (SEGMENT_LENGTH + SEGMENT_PADDING));
141+
return temp_storage.Alias() + (linear_tid * (SEGMENT_LENGTH + SEGMENT_PADDING));
139142
}
140143
};
141144

test/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ INC += -I. -I..
195195
# Libs
196196
#-------------------------------------------------------------------------------
197197

198-
LIBS += -lcudart
198+
#LIBS += -lcudart
199199

200200

201201
#-------------------------------------------------------------------------------

test/test_device_radix_sort.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ int main(int argc, char** argv)
713713
#ifdef QUICK_TEST
714714

715715
// Compile/run quick tests
716-
if (num_items < 0) num_items = 32000000;
716+
if (num_items < 0) num_items = 20000000;
717717

718718
// Compare CUB and thrust on 32b keys-only
719719
Test<CUB, unsigned int, NullType, false> (num_items, RANDOM, entropy_reduction, 0, g_bits, CUB_TYPE_STRING(unsigned int));

0 commit comments

Comments
 (0)