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

Commit 49391da

Browse files
committed
- Fixes and tests for BlockHistogram
- Doc updates to v1.0.2 Former-commit-id: 526f484
1 parent 863e925 commit 49391da

File tree

196 files changed

+2006
-1600
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+2006
-1600
lines changed

CHANGE_LOG.TXT

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
//-----------------------------------------------------------------------------
22

3+
1.0.2 08/23/2013
4+
- Corrections to code snippet examples for BlockLoad, BlockStore, and BlockDiscontinuity
5+
- Cleaned up unnecessary/missing header includes. You can now safely #inlude a specific .cuh (instead of cub.cuh)
6+
- Bug/compilation fixes for BlockHistogram
7+
8+
//-----------------------------------------------------------------------------
9+
310
1.0.1 08/08/2013
411
- New collective interface idiom (specialize::construct::invoke).
512
- Added best-in-class DeviceRadixSort. Implements short-circuiting for homogenous digit passes.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<hr>
22
<h3>About CUB</h3>
33

4-
Current release: v1.0.1 (August 8, 2013)
4+
Current release: v1.0.2 (August 23, 2013)
55

66
We recommend the [CUB Project Website](http://nvlabs.github.com/cub) and the [cub-users discussion forum](http://groups.google.com/group/cub-users) for further information and examples.
77

cub/block/block_histogram.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ public:
306306
histogram[histo_offset + linear_tid] = 0;
307307
}
308308
// Finish up with guarded initialization if necessary
309-
if ((histo_offset < BLOCK_THREADS) && (histo_offset + linear_tid < BINS))
309+
if ((BINS % BLOCK_THREADS != 0) && (histo_offset + linear_tid < BINS))
310310
{
311311
histogram[histo_offset + linear_tid] = 0;
312312
}

cub/block/specializations/block_histogram_sort.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ struct BlockHistogramSort
152152
temp_storage.run_end[histo_offset + linear_tid] = TILE_SIZE;
153153
}
154154
// Finish up with guarded initialization if necessary
155-
if ((histo_offset < BLOCK_THREADS) && (histo_offset + linear_tid < BINS))
155+
if ((BINS % BLOCK_THREADS != 0) && (histo_offset + linear_tid < BINS))
156156
{
157157
temp_storage.run_begin[histo_offset + linear_tid] = TILE_SIZE;
158158
temp_storage.run_end[histo_offset + linear_tid] = TILE_SIZE;
@@ -182,7 +182,7 @@ struct BlockHistogramSort
182182
histogram[thread_offset] += count;
183183
}
184184
// Finish up with guarded composition if necessary
185-
if ((histo_offset < BLOCK_THREADS) && (histo_offset + linear_tid < BINS))
185+
if ((BINS % BLOCK_THREADS != 0) && (histo_offset + linear_tid < BINS))
186186
{
187187
int thread_offset = histo_offset + linear_tid;
188188
HistoCounter count = temp_storage.run_end[thread_offset] - temp_storage.run_begin[thread_offset];

cub/device/block/specializations/block_histo_tiles_satomic.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ struct BlockHistogramTilesSharedAtomic
127127
this->temp_storage.histograms[CHANNEL][histo_offset + threadIdx.x] = 0;
128128
}
129129
// Finish up with guarded initialization if necessary
130-
if ((histo_offset < BLOCK_THREADS) && (histo_offset + threadIdx.x < BINS))
130+
if ((BINS % BLOCK_THREADS != 0) && (histo_offset + threadIdx.x < BINS))
131131
{
132132
this->temp_storage.histograms[CHANNEL][histo_offset + threadIdx.x] = 0;
133133
}
@@ -222,7 +222,7 @@ struct BlockHistogramTilesSharedAtomic
222222
d_out_histograms[CHANNEL][channel_offset + histo_offset + threadIdx.x] = temp_storage.histograms[CHANNEL][histo_offset + threadIdx.x];
223223
}
224224
// Finish up with guarded initialization if necessary
225-
if ((histo_offset < BLOCK_THREADS) && (histo_offset + threadIdx.x < BINS))
225+
if ((BINS % BLOCK_THREADS != 0) && (histo_offset + threadIdx.x < BINS))
226226
{
227227
d_out_histograms[CHANNEL][channel_offset + histo_offset + threadIdx.x] = temp_storage.histograms[CHANNEL][histo_offset + threadIdx.x];
228228
}

cub/util_allocator.cuh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@
3333

3434
#pragma once
3535

36+
#ifndef __CUDA_ARCH__
37+
#include <set> // NVCC (EDG, really) takes FOREVER to compile std::map
38+
#include <map>
39+
#endif
40+
3641
#include <math.h>
37-
#include <set>
38-
#include <map>
3942

4043
#include "util_namespace.cuh"
4144
#include "util_debug.cuh"
@@ -199,6 +202,8 @@ struct CachingDeviceAllocator
199202
/// BlockDescriptor comparator function interface
200203
typedef bool (*Compare)(const BlockDescriptor &, const BlockDescriptor &);
201204

205+
#ifndef __CUDA_ARCH__ // Only define STL container members in host code
206+
202207
/// Set type for cached blocks (ordered by size)
203208
typedef std::multiset<BlockDescriptor, Compare> CachedBlocks;
204209

@@ -208,6 +213,7 @@ struct CachingDeviceAllocator
208213
/// Map type of device ordinals to the number of cached bytes cached by each device
209214
typedef std::map<int, size_t> GpuCachedBytes;
210215

216+
#endif // __CUDA_ARCH__
211217

212218
//---------------------------------------------------------------------
213219
// Fields

docs/Doxyfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ INLINE_INFO = YES
467467
# alphabetically by member name. If set to NO the members will appear in
468468
# declaration order.
469469

470-
SORT_MEMBER_DOCS = NO
470+
SORT_MEMBER_DOCS = YES
471471

472472
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
473473
# brief documentation of file, namespace and class members alphabetically
@@ -816,7 +816,7 @@ FILTER_SOURCE_PATTERNS =
816816
# Note: To get rid of all source code in the generated output, make sure also
817817
# VERBATIM_HEADERS is set to NO.
818818

819-
SOURCE_BROWSER = NO
819+
SOURCE_BROWSER = YES
820820

821821
# Setting the INLINE_SOURCES tag to YES will include the body
822822
# of functions and classes directly in the documentation.

docs/download_cub.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@
3737
</head>
3838

3939
<body
40-
onload="downloadURL('https://github.com/NVlabs/cub/archive/1.0.1.zip');"
40+
onload="downloadURL('https://github.com/NVlabs/cub/archive/1.0.2.zip');"
4141
style="color: rgb(102, 102, 102); font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: 300; height: 18px;">
4242

4343
<center>
4444
If your download doesn't start in 3s:
4545
<br><br>
46-
<a href="https://github.com/NVlabs/cub/archive/1.0.1.zip"><img src="download-icon.png" style="position:relative; bottom:-10px; border:0px;"/></a>
47-
<a href="https://github.com/NVlabs/cub/archive/1.0.1.zip"><em>Download CUB!</em></a>
46+
<a href="https://github.com/NVlabs/cub/archive/1.0.2.zip"><img src="download-icon.png" style="position:relative; bottom:-10px; border:0px;"/></a>
47+
<a href="https://github.com/NVlabs/cub/archive/1.0.2.zip"><em>Download CUB!</em></a>
4848
</center>
4949

5050
</body>

docs/extra_stylesheet.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ table.memname tbody tr:first-child td:nth-child(2) {
267267
}
268268

269269
table.memname tbody tr td {
270-
line-height: normal;
271270
}
272271

273272
table.memname tbody tr td.paramtype {
@@ -422,6 +421,8 @@ td.memname, td.paramtype, div.memtemplate {
422421
}
423422

424423
.memtemplate {
424+
padding-bottom: 10px;
425+
line-height: 180%;
425426
font-size: 85%;
426427
color: cadetblue;
427428
}

0 commit comments

Comments
 (0)