nativevecadd workinggit status

This commit is contained in:
fares
2019-11-16 21:37:35 -05:00
parent ed5c628c3b
commit 650d6141ab
62 changed files with 2087350 additions and 33 deletions

View File

@@ -1,6 +1,7 @@
#include "../intrinsics/vx_intrinsics.h"
#include "vx_api.h"
#include <inttypes.h>
#ifdef __cplusplus
extern "C" {
@@ -39,16 +40,25 @@ void vx_spawnWarps(unsigned numWarps, unsigned numThreads, func_t func_ptr, void
}
void pocl_spawn(context_t * ctx, const void * pfn, void * arguments)
{
vx_pocl_workgroup_func use_pfn = (vx_pocl_workgroup_func) pfn;
int z;
int y;
int x;
for (z = 0; z < ctx->num_groups[2]; ++z)
{
for (y = 0; y < ctx->num_groups[1]; ++y)
{
for (x = 0; x < ctx->num_groups[0]; ++x)
{
(use_pfn)((uint8_t *)arguments, (uint8_t *)ctx, x, y, z);
}
}
}
}
#ifdef __cplusplus
}
#endif
// void vx_cl_spawnWarps(char * args, char * pocl_context, long group_x, long group_y, long group_z)
// {
// if (group_z != 1)
// {
// vx_printf("ERROR: group_z should be set equal to 1");
// return;
// }
// vx_spawnWarps(group_y, group_x, )
// }

View File

@@ -3,6 +3,8 @@
#define VX_API_
#include <inttypes.h>
#ifdef __cplusplus
extern "C" {
#endif
@@ -11,12 +13,43 @@ typedef void (*func_t)(void *);
void vx_spawnWarps(unsigned numWarps, unsigned numThreads, func_t func_ptr , void * args);
// struct context_t {
void vx_cl_spawnWarps (char * /* args */,
char * /* pocl_context */,
long /* group_x */,
long /* group_y */,
long /* group_z */);
// unsigned num_groups[3]; // use {2, 1, 1} for vecadd
// unsigned global_offset[3]; // use {0, 0, 0} for vecadd
// unsigned local_size[3]; // use {2, 1, 1} for vecadd
// unsigned char *printf_buffer; // zero for now
// unsigned *printf_buffer_position; // initialized to zero
// unsigned printf_buffer_capacity; // zero for now
// unsigned work_dim; // use 1 for vecadd
// };
struct context_t {
uint32_t num_groups[3];
uint32_t global_offset[3];
uint32_t local_size[3];
uint8_t *printf_buffer;
uint32_t *printf_buffer_position;
uint32_t printf_buffer_capacity;
uint32_t work_dim;
};
/* The default work-group function prototype as generated by Workgroup.cc. */
typedef void (*vx_pocl_workgroup_func) (uint8_t * /* args */,
uint8_t * /* pocl_context */,
uint32_t /* group_x */,
uint32_t /* group_y */,
uint32_t /* group_z */);
void pocl_spawn(context_t * ctx, const void * pfn, void * arguments);
#ifdef __cplusplus
}