HCC
HCC is a single-source, C/C++ compiler for heterogeneous computing. It's optimized with HSA (http://www.hsafoundation.com/).
grid_launch.hpp
1 #pragma once
2 
3 #include "grid_launch.h"
4 #include "hc.hpp"
5 
7 {
8 public:
9  grid_launch_parm_cxx() = default;
10 
11  // customized serialization: don't need av and cf in kernel
12  __attribute__((annotate("serialize")))
13  void __cxxamp_serialize(Kalmar::Serialize& s) const {
14  s.Append(sizeof(int), &grid_dim.x);
15  s.Append(sizeof(int), &grid_dim.y);
16  s.Append(sizeof(int), &grid_dim.z);
17  s.Append(sizeof(int), &group_dim.x);
18  s.Append(sizeof(int), &group_dim.y);
19  s.Append(sizeof(int), &group_dim.z);
20  }
21 
22  __attribute__((annotate("user_deserialize")))
23  grid_launch_parm_cxx(int grid_dim_x, int grid_dim_y, int grid_dim_z,
24  int group_dim_x, int group_dim_y, int group_dim_z) {
25  grid_dim.x = grid_dim_x;
26  grid_dim.y = grid_dim_y;
27  grid_dim.z = grid_dim_z;
28  group_dim.x = group_dim_x;
29  group_dim.y = group_dim_y;
30  group_dim.z = group_dim_z;
31  }
32 };
33 
34 
35 extern inline void grid_launch_init(grid_launch_parm *lp) {
36  lp->grid_dim.x = lp->grid_dim.y = lp->grid_dim.z = 1;
37 
38  lp->group_dim.x = lp->group_dim.y = lp->group_dim.z = 1;
39 
41 
42  lp->barrier_bit = barrier_bit_queue_default;
43  lp->launch_fence = -1;
44 
45  // TODO - set to NULL?
47  lp->av = &av;
48  lp->cf = NULL;
49 }
50 
Heterogeneous C++ (HC) API.
hc::accelerator_view * av
Pointer to the accelerator_view where the kernel should execute.
Definition: grid_launch.h:57
gl_dim3 grid_dim
Grid dimensions.
Definition: grid_launch.h:34
unsigned int launch_fence
Value of packet fences to apply to launch.
Definition: grid_launch.h:53
accelerator_view get_default_view() const
Returns the default accelerator_view associated with the accelerator.
Definition: hc.hpp:813
Represents a logical (isolated) accelerator view of a compute accelerator.
Definition: hc.hpp:120
hc::completion_future * cf
Pointe to the completion_future used to track the status of the command.
Definition: grid_launch.h:63
enum gl_barrier_bit barrier_bit
Control setting of barrier bit on per-packet basis: See gl_barrier_bit description.
Definition: grid_launch.h:46
Definition: grid_launch.h:31
gl_dim3 group_dim
Group dimensions.
Definition: grid_launch.h:37
Definition: grid_launch.hpp:6
unsigned int dynamic_group_mem_bytes
Amount of dynamic group memory to use with the kernel launch.
Definition: grid_launch.h:37
Represents a physical accelerated computing device.
Definition: hc.hpp:700