Skip to content

Commit 08cdc28

Browse files
committed
Fix ts compile when PIM_KERNEL is off
1 parent e41e802 commit 08cdc28

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/tensor/ts.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ void fp_table_init(void) {
1919
}
2020
}
2121

22+
#ifdef PIM_KERNEL
2223
int gemv_dpu_kernel(struct pim_context *context, struct ggml_tensor * w, struct ggml_tensor * in_q, struct ggml_tensor * res) {
2324
uint32_t pim_offset = 0;
2425
struct dpu_set_t dpu;
@@ -116,6 +117,7 @@ int gemv_dpu_kernel(struct pim_context *context, struct ggml_tensor * w, struct
116117

117118
return 0;
118119
}
120+
#endif
119121

120122

121123
void gemv_cpu_kernel(struct pim_context *context, struct ggml_tensor * w, struct ggml_tensor * in_q, struct ggml_tensor * res_comp) {
@@ -164,6 +166,7 @@ int main(int argc, char** argv) {
164166
// init fp table for fp16 dump
165167
fp_table_init();
166168

169+
#ifdef PIM_KERNEL
167170
// WQ-PIM allocate dpu
168171
struct pim_context *pqcontext = (struct pim_context *)malloc(sizeof(struct pim_context));
169172
memset(pqcontext,0,sizeof(struct pim_context));
@@ -213,6 +216,6 @@ int main(int argc, char** argv) {
213216
// float first_res = mul_add_q4_0_q8_0(ts_a, ts_bq);
214217
// std::cout<<"first element: "<<std::fixed << std::setprecision(6)<<first_res<<std::endl;
215218

216-
219+
#endif
217220
return 0;
218221
}

0 commit comments

Comments
 (0)