Skip to content

Commit

Permalink
add kvec (vectorized device data type) definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
kaigai committed Sep 19, 2023
1 parent 321bb8a commit 87cecc2
Show file tree
Hide file tree
Showing 16 changed files with 941 additions and 503 deletions.
7 changes: 5 additions & 2 deletions src/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ static List *devfunc_code_slot[DEVFUNC_INFO_NSLOTS]; /* by FuncOpCode */
DEVKIND__ANY | (FLAGS), \
devtype_##NAME##_hash, \
sizeof(xpu_##NAME##_t), \
__alignof__(xpu_##NAME##_t) },
__alignof__(xpu_##NAME##_t), \
sizeof(kvec_##NAME##_t) },
static struct {
const char *type_extension;
const char *type_name;
Expand All @@ -38,10 +39,11 @@ static struct {
devtype_hashfunc_f type_hashfunc;
int type_sizeof;
int type_alignof;
int kvec_sizeof;
} devtype_catalog[] = {
#include "xpu_opcodes.h"
/* alias device data types */
{NULL, NULL, TypeOpCode__Invalid, 0, NULL, 0}
{NULL, NULL, TypeOpCode__Invalid, 0, NULL, 0, 0}
};

static struct {
Expand Down Expand Up @@ -112,6 +114,7 @@ build_basic_devtype_info(TypeCacheEntry *tcache, const char *ext_name)
dtype->type_extension = (ext_name ? pstrdup(ext_name) : NULL);
dtype->type_sizeof = devtype_catalog[i].type_sizeof;
dtype->type_alignof = devtype_catalog[i].type_alignof;
dtype->kvec_sizeof = devtype_catalog[i].kvec_sizeof;
dtype->type_hashfunc = devtype_catalog[i].type_hashfunc;
/* type equality functions */
dtype->type_eqfunc = get_opcode(tcache->eq_opr);
Expand Down
Loading

0 comments on commit 87cecc2

Please sign in to comment.