-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkernels.cuh
53 lines (43 loc) · 1.34 KB
/
kernels.cuh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef WORDER_KERNELS_CUH_
#define WORDER_KERNELS_CUH_
// CUDA
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
// To make the IDE recognise CUDA functions
#ifndef __CUDACC__
#define __CUDACC__
#endif
// Package
#include "general.hpp"
namespace kernels
{
/// <summary>
/// Kernel function to preprocess data for lowercasing
/// </summary>
/// <param name="data">The target data</param>
/// <param name="data_length">The length of the data in words</param>
__global__ void lowerData(
char* data
, const size_t data_length);
/// <summary>
/// Kernel function to preprocess data for punctuation removal
/// </summary>
/// <param name="data">The target data</param>
/// <param name="data_length">The length of the data in words</param>
__global__ void removeExcessives(
char* data
, const size_t data_length);
/// <summary>
/// Kernel function to process data to produce the keywords histogram
/// </summary>
/// <param name="data">The target data</param>
/// <param name="data_length">The length of the data in words</param>
/// <param name="keywords">The keywords to search the data for</param>
/// <param name="histogram">The histogram of keywords to update</param
__global__ void countWords(
const char* data
, const size_t data_length
, const char* keywords
, int* histogram);
}
#endif // WORDER_KERNELS_CUH_