ElfPSP_ParallelABC
Protein Structure Prediction using Parallel Artificial Bee Colony Optimization
CUDA_header.h
Go to the documentation of this file.
1 #ifndef _CUDA_HEADER_
2 #define _CUDA_HEADER_
3 
7 struct CollisionCountPromise { // Vectors of # of collisions
8  int *d_toReduce;
9  int *d_reduced;
10 };
11 
13 typedef struct {
14  float x;
15  float y;
16  float z;
17 } ElfFloat3d;
18 
20 typedef struct {
21  int x;
22  int y;
23  int z;
24 } ElfInt3d;
25 
26 /*
27 Launches the GPU procedure for counting collisions in 'vector' which has size 'size'.
28 
29 This function does not wait until the GPU procedure is finished.
30 It returns a "Promise" structure which represents a promise for a future return value.
31 The return value can be fetched with the _fetch corresponding function.
32 */
34  count_collisions_launch(ElfFloat3d *vector, int size);
35 
36 /*
37 Returns the number of collisions associated with the given "Promise" structure.
38 
39 The "Promise" structure is a promise for a future return value, which is returned
40  by the non-blocking _launch function.
41 */
42 int count_collisions_fetch(struct CollisionCountPromise promise);
43 
44 
45 // The functions below have similar behavior as the above ones.
47  count_contacts_launch(ElfFloat3d *vector, int size);
48 
49 int count_contacts_fetch(struct CollisionCountPromise promise);
50 
51 #endif
Holds a triple of integer numbers.
Definition: CUDA_header.h:20
Holds a triple of floats.
Definition: CUDA_header.h:13
A "key" that can be used to fetch results of non-blocking computations sent to the GPU...
Definition: CUDA_header.h:7