Skip to content

Commit

Permalink
dpuserv workable
Browse files Browse the repository at this point in the history
  • Loading branch information
kaigai committed Aug 26, 2024
1 parent 4196187 commit 61e9488
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/heterodb_extra.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*/
#ifndef HETERODB_EXTRA_H
#define HETERODB_EXTRA_H
#include <cuda.h>
#include <stdbool.h>
#include <stdint.h>

Expand Down Expand Up @@ -75,6 +74,10 @@ extern int heterodbValidateDevice(const char *gpu_device_name,
extern const char *heterodbInitOptimalGpus(const char *manual_config);
extern int64_t heterodbGetOptimalGpus(const char *path,
const char *policy);
/*
* GPU related stuff must include <cuda.h> first, but DPU stuff skips them
*/
#ifdef __cuda_cuda_h__
extern bool gpuDirectInitDriver(void);
extern bool gpuDirectOpenDriver(void);
extern bool gpuDirectCloseDriver(void);
Expand All @@ -101,6 +104,7 @@ extern bool gpuDirectFileReadAsyncIOV(const char *pathname,
uint32_t *p_error_code_async,
uint32_t *p_npages_direct_read,
uint32_t *p_npages_vfs_read);
#endif /* __cuda_cuda_h__ */
extern const char *gpuDirectGetProperty(void);
extern bool gpuDirectSetProperty(const char *key,
const char *value);
Expand Down
1 change: 1 addition & 0 deletions src/xpu_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ typedef struct
assert(vs_ops->xpu_type_alignof <= 16); \
KCXT->kvars_slot[__i] = (struct xpu_datum_t *) \
alloca(vs_ops->xpu_type_sizeof); \
KCXT->kvars_slot[__i]->expr_ops = NULL; \
} \
KCXT->kvars_desc = __vs_desc; \
KCXT->vlpos = KCXT->vlbuf; \
Expand Down
9 changes: 6 additions & 3 deletions src/xpu_timelib.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2780,9 +2780,12 @@ pgfn_interval_um(XPU_PGFUNCTION_ARGS)
result->value.month = -ival.value.month;
result->value.day = -ival.value.day;
result->value.time = -ival.value.time;
if (result->value.time != 0 && SAMESIGN(ival.value.time, result->value.time) ||
result->value.day != 0 && SAMESIGN(ival.value.day, result->value.day) ||
result->value.month != 0 && SAMESIGN(ival.value.month, result->value.month))
if ((result->value.time != 0 && SAMESIGN(ival.value.time,
result->value.time)) ||
(result->value.day != 0 && SAMESIGN(ival.value.day,
result->value.day)) ||
(result->value.month != 0 && SAMESIGN(ival.value.month,
result->value.month)))
{
STROM_ELOG(kcxt, "interval out of range");
return false;
Expand Down

0 comments on commit 61e9488

Please sign in to comment.