-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoop.h
More file actions
43 lines (31 loc) · 638 Bytes
/
Loop.h
File metadata and controls
43 lines (31 loc) · 638 Bytes
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
/*
* Loop.h
*
* Created on: Sep 24, 2015
* Author: ben
*/
#ifndef LOOP_H_
#define LOOP_H_
#include "mycuda.cuh"
//void(*f)(int*,int) CUDA DON"T LIKE
struct arg{
unsigned int* a;
unsigned int* b;
unsigned int* c;
};
typedef void (*loop_kernal)(void* , unsigned, unsigned);
template<class O>
void loop_exec( O op,
void* arg, unsigned arg_bytes,
unsigned n);
void* loop_malloc( unsigned n);
void loop_free( void *p);
void GENDATA( void *p);
template<class O> __global__
void loop_helper( O op,
void* arg, unsigned arg_bytes)
{
unsigned i = CUDAINDEX;
op( arg , arg_bytes, i);
}
#endif /* LOOP_H_ */