MCPcopy Create free account
hub / github.com/clMathLibraries/clBLAS / usehostptr_roundtrip_func

Method usehostptr_roundtrip_func

src/client/clfunc_xtrsm.hpp:393–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391 timer.Stop(timer_id);
392 }
393 void usehostptr_roundtrip_func()
394 {
395 timer.Start(timer_id);
396 //set up buffer
397 cl_int err;
398 buffer_.buf_a_ = clCreateBuffer(ctx_, CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR,
399 (buffer_.lda_ * buffer_.a_num_vectors_ +
400 buffer_.offA_) * sizeof(T),
401 buffer_.a_, &err);
402
403 buffer_.buf_b_ = clCreateBuffer(ctx_, CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR,
404 (buffer_.ldb_ * buffer_.b_num_vectors_ +
405 buffer_.offB_) * sizeof(T),
406 buffer_.b_, &err);
407 //call func
408 xTrsm_Function(false);
409 //read gpu buffer
410 err = clEnqueueReadBuffer(queues_[0], buffer_.buf_b_, CL_TRUE,
411 buffer_.offB_ * sizeof(T), buffer_.ldb_ * buffer_.b_num_vectors_ *
412 sizeof(T),
413 buffer_.b_, 0, NULL, &event_);
414 clWaitForEvents(1, &event_);
415 timer.Stop(timer_id);
416 }
417 void copyhostptr_roundtrip_func()
418 {
419 timer.Start(timer_id);

Callers 1

mainFunction · 0.45

Calls 2

StartMethod · 0.80
StopMethod · 0.80

Tested by

no test coverage detected