Skip to content

Commit d481f72

Browse files
author
Timmy
committed
add memalloc options to client (gemm and trsm)
1 parent b706e88 commit d481f72

File tree

11 files changed

+512
-458
lines changed

11 files changed

+512
-458
lines changed

src/client/clfunc_common.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
#include "dis_warning.h"
2929

3030
#include "clBLAS.h"
31+
#if defined(__APPLE__) || defined(__MACOSX)
32+
#include <OpenCL/cl_ext.h>
33+
#else
34+
#include <CL/cl_ext.h>
35+
#endif
3136

3237
template<typename T>
3338
static T
@@ -243,6 +248,7 @@ class clblasFunc
243248
OPENCL_V_THROW(err, "creating context");
244249
queue_ = clCreateCommandQueue(ctx_, device_, 0, &err);
245250

251+
246252
timer_id = timer.getUniqueID( "clfunc", 0 );
247253

248254

@@ -307,6 +313,10 @@ class clblasFunc
307313
virtual void reset_gpu_write_buffer() = 0;
308314
virtual void read_gpu_buffer() = 0;
309315
virtual void roundtrip_func() = 0;
316+
virtual void allochostptr_roundtrip_func() {}
317+
virtual void usehostptr_roundtrip_func() {}
318+
virtual void copyhostptr_roundtrip_func() {}
319+
virtual void usepersismem_roundtrip_func() {}
310320
virtual void roundtrip_setup_buffer(int order_option, int side_option,
311321
int uplo_option, int diag_option, int
312322
transA_option, int transB_option,

src/client/clfunc_xgemm.hpp

Lines changed: 245 additions & 245 deletions
Large diffs are not rendered by default.

src/client/clfunc_xher2k.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,10 @@ class xHer2k : public clblasFunc
344344
buffer_.cpuC_, 0, NULL, NULL);
345345
}
346346
void roundtrip_func();
347+
void zerocopy_roundtrip_func()
348+
{
349+
std::cout << "xTrmm::zerocopy_roundtrip_func\n";
350+
}
347351
void roundtrip_setup_buffer(int order_option, int side_option, int uplo_option,
348352
int diag_option, int transA_option, int transB_option,
349353
size_t M, size_t N, size_t K, size_t lda, size_t ldb,

src/client/clfunc_xherk.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,10 @@ class xHerk : public clblasFunc
273273
buffer_.cpuC_, 0, NULL, NULL);
274274
}
275275
void roundtrip_func();
276+
void zerocopy_roundtrip_func()
277+
{
278+
std::cout << "xTrmm::zerocopy_roundtrip_func\n";
279+
}
276280
void roundtrip_setup_buffer(int order_option, int side_option, int uplo_option,
277281
int diag_option, int transA_option, int transB_option,
278282
size_t M, size_t N, size_t K, size_t lda, size_t ldb,

src/client/clfunc_xsymm.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ class xSymm : public clblasFunc
9898
{
9999
std::cout << "xSymm::roundtrip_func\n";
100100
}
101+
void zerocopy_roundtrip_func()
102+
{
103+
std::cout << "xSymm::zerocopy_roundtrip_func\n";
104+
}
101105
void roundtrip_setup_buffer(int order_option, int side_option, int uplo_option,
102106
int diag_option, int transA_option, int transB_option,
103107
size_t M, size_t N, size_t K, size_t lda, size_t ldb,

src/client/clfunc_xsyr2k.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,10 @@ class xSyr2k : public clblasFunc
364364
void roundtrip_func()
365365
{
366366
}
367+
void zerocopy_roundtrip_func()
368+
{
369+
std::cout << "xTrmm::zerocopy_roundtrip_func\n";
370+
}
367371
void roundtrip_setup_buffer(int order_option, int side_option, int uplo_option,
368372
int diag_option, int transA_option, int transB_option,
369373
size_t M, size_t N, size_t K, size_t lda, size_t ldb,

src/client/clfunc_xsyrk.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,10 @@ class xSyrk : public clblasFunc
282282
void roundtrip_func()
283283
{
284284
}
285+
void zerocopy_roundtrip_func()
286+
{
287+
std::cout << "xSyrk::zerocopy_roundtrip_func\n";
288+
}
285289
void roundtrip_setup_buffer(int order_option, int side_option, int uplo_option,
286290
int diag_option, int transA_option, int transB_option,
287291
size_t M, size_t N, size_t K, size_t lda, size_t ldb,

src/client/clfunc_xtrmm.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,11 @@ class xTrmm : public clblasFunc
304304
}
305305
void roundtrip_func()
306306
{
307-
std::cout << "xGemm::roundtrip_func\n";
307+
std::cout << "xTrmm::roundtrip_func\n";
308+
}
309+
void zerocopy_roundtrip_func()
310+
{
311+
std::cout << "xTrmm::zerocopy_roundtrip_func\n";
308312
}
309313
void roundtrip_setup_buffer(int order_option, int side_option, int uplo_option,
310314
int diag_option, int transA_option, int transB_option,

0 commit comments

Comments
 (0)