2 * Copyright 1993-2013 NVIDIA Corporation. All rights reserved.
4 * Please refer to the NVIDIA end user license agreement (EULA) associated
5 * with this source code for terms and conditions that govern your use of
6 * this software. Any use, reproduction, disclosure, or distribution of
7 * this software and related documentation outside the terms of the EULA
8 * is strictly prohibited.
15 #include "histogram_common.h"
19 extern "C" void histogram64CPU(
25 for (uint i = 0; i < HISTOGRAM64_BIN_COUNT; i++)
28 assert(sizeof(uint) == 4 && (byteCount % 4) == 0);
30 for (uint i = 0; i < (byteCount / 4); i++)
32 uint data = ((uint *)h_Data)[i];
33 h_Histogram[(data >> 2) & 0x3FU]++;
34 h_Histogram[(data >> 10) & 0x3FU]++;
35 h_Histogram[(data >> 18) & 0x3FU]++;
36 h_Histogram[(data >> 26) & 0x3FU]++;
42 extern "C" void histogram256CPU(
48 for (uint i = 0; i < HISTOGRAM256_BIN_COUNT; i++)
51 assert(sizeof(uint) == 4 && (byteCount % 4) == 0);
53 for (uint i = 0; i < (byteCount / 4); i++)
55 uint data = ((uint *)h_Data)[i];
56 h_Histogram[(data >> 0) & 0xFFU]++;
57 h_Histogram[(data >> 8) & 0xFFU]++;
58 h_Histogram[(data >> 16) & 0xFFU]++;
59 h_Histogram[(data >> 24) & 0xFFU]++;