2015-08-13 13:46:13 +02:00
|
|
|
|
|
|
|
// =================================================================================================
|
|
|
|
// This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. This
|
|
|
|
// project loosely follows the Google C++ styleguide and uses a tab-size of two spaces and a max-
|
|
|
|
// width of 100 characters per line.
|
|
|
|
//
|
|
|
|
// Author(s):
|
|
|
|
// Cedric Nugteren <www.cedricnugteren.nl>
|
|
|
|
//
|
|
|
|
// This file implements all the plain C BLAS API calls. This forwards the calls to the C++ API.
|
|
|
|
//
|
|
|
|
// =================================================================================================
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2016-03-23 20:49:28 +01:00
|
|
|
#include "clblast_c.h"
|
2015-08-13 13:46:13 +02:00
|
|
|
#include "clblast.h"
|
|
|
|
#include "internal/utilities.h"
|
|
|
|
|
2015-08-22 17:11:20 +02:00
|
|
|
// Shortcuts to the clblast namespace
|
|
|
|
using float2 = clblast::float2;
|
|
|
|
using double2 = clblast::double2;
|
|
|
|
|
2015-08-13 13:46:13 +02:00
|
|
|
// =================================================================================================
|
|
|
|
// BLAS level-1 (vector-vector) routines
|
|
|
|
// =================================================================================================
|
|
|
|
|
2016-03-30 16:17:16 +02:00
|
|
|
// ROTG
|
2016-03-30 17:32:13 +02:00
|
|
|
StatusCode CLBlastSrotg(cl_mem sa_buffer, const size_t sa_offset,
|
|
|
|
cl_mem sb_buffer, const size_t sb_offset,
|
|
|
|
cl_mem sc_buffer, const size_t sc_offset,
|
|
|
|
cl_mem ss_buffer, const size_t ss_offset,
|
2016-03-30 16:17:16 +02:00
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2016-03-30 17:32:13 +02:00
|
|
|
auto status = clblast::Rotg<float>(sa_buffer, sa_offset,
|
|
|
|
sb_buffer, sb_offset,
|
|
|
|
sc_buffer, sc_offset,
|
|
|
|
ss_buffer, ss_offset,
|
2016-03-30 16:17:16 +02:00
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-30 17:32:13 +02:00
|
|
|
StatusCode CLBlastDrotg(cl_mem sa_buffer, const size_t sa_offset,
|
|
|
|
cl_mem sb_buffer, const size_t sb_offset,
|
|
|
|
cl_mem sc_buffer, const size_t sc_offset,
|
|
|
|
cl_mem ss_buffer, const size_t ss_offset,
|
2016-03-30 16:17:16 +02:00
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2016-03-30 17:32:13 +02:00
|
|
|
auto status = clblast::Rotg<double>(sa_buffer, sa_offset,
|
|
|
|
sb_buffer, sb_offset,
|
|
|
|
sc_buffer, sc_offset,
|
|
|
|
ss_buffer, ss_offset,
|
2016-03-30 16:17:16 +02:00
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
2016-03-30 17:32:13 +02:00
|
|
|
// ROTMG
|
|
|
|
StatusCode CLBlastSrotmg(cl_mem sd1_buffer, const size_t sd1_offset,
|
|
|
|
cl_mem sd2_buffer, const size_t sd2_offset,
|
|
|
|
cl_mem sx1_buffer, const size_t sx1_offset,
|
2016-04-02 07:36:39 +02:00
|
|
|
const cl_mem sy1_buffer, const size_t sy1_offset,
|
2016-03-30 17:32:13 +02:00
|
|
|
cl_mem sparam_buffer, const size_t sparam_offset,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Rotmg<float>(sd1_buffer, sd1_offset,
|
|
|
|
sd2_buffer, sd2_offset,
|
|
|
|
sx1_buffer, sx1_offset,
|
|
|
|
sy1_buffer, sy1_offset,
|
|
|
|
sparam_buffer, sparam_offset,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
StatusCode CLBlastDrotmg(cl_mem sd1_buffer, const size_t sd1_offset,
|
|
|
|
cl_mem sd2_buffer, const size_t sd2_offset,
|
|
|
|
cl_mem sx1_buffer, const size_t sx1_offset,
|
2016-04-02 07:36:39 +02:00
|
|
|
const cl_mem sy1_buffer, const size_t sy1_offset,
|
2016-03-30 17:32:13 +02:00
|
|
|
cl_mem sparam_buffer, const size_t sparam_offset,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Rotmg<double>(sd1_buffer, sd1_offset,
|
|
|
|
sd2_buffer, sd2_offset,
|
|
|
|
sx1_buffer, sx1_offset,
|
|
|
|
sy1_buffer, sy1_offset,
|
|
|
|
sparam_buffer, sparam_offset,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
2016-03-30 16:17:16 +02:00
|
|
|
// ROT
|
|
|
|
StatusCode CLBlastSrot(const size_t n,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
2016-03-30 17:32:13 +02:00
|
|
|
const float cos,
|
|
|
|
const float sin,
|
2016-03-30 16:17:16 +02:00
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Rot(n,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
2016-03-30 17:32:13 +02:00
|
|
|
cos,
|
|
|
|
sin,
|
2016-03-30 16:17:16 +02:00
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
StatusCode CLBlastDrot(const size_t n,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
2016-03-30 17:32:13 +02:00
|
|
|
const double cos,
|
|
|
|
const double sin,
|
2016-03-30 16:17:16 +02:00
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Rot(n,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
2016-03-30 17:32:13 +02:00
|
|
|
cos,
|
|
|
|
sin,
|
2016-03-30 16:17:16 +02:00
|
|
|
queue, event);
|
2016-03-30 17:32:13 +02:00
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ROTM
|
|
|
|
StatusCode CLBlastSrotm(const size_t n,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_mem sparam_buffer, const size_t sparam_offset,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Rotm<float>(n,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
sparam_buffer, sparam_offset,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
StatusCode CLBlastDrotm(const size_t n,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_mem sparam_buffer, const size_t sparam_offset,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Rotm<double>(n,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
sparam_buffer, sparam_offset,
|
|
|
|
queue, event);
|
2016-03-30 16:17:16 +02:00
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
2015-08-22 17:11:20 +02:00
|
|
|
// SWAP
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastSswap(const size_t n,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-22 17:11:20 +02:00
|
|
|
auto status = clblast::Swap<float>(n,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDswap(const size_t n,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-22 17:11:20 +02:00
|
|
|
auto status = clblast::Swap<double>(n,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCswap(const size_t n,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-22 17:11:20 +02:00
|
|
|
auto status = clblast::Swap<float2>(n,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZswap(const size_t n,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-22 17:11:20 +02:00
|
|
|
auto status = clblast::Swap<double2>(n,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// SCAL
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastSscal(const size_t n,
|
|
|
|
const float alpha,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-22 17:11:20 +02:00
|
|
|
auto status = clblast::Scal(n,
|
|
|
|
alpha,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDscal(const size_t n,
|
|
|
|
const double alpha,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-22 17:11:20 +02:00
|
|
|
auto status = clblast::Scal(n,
|
|
|
|
alpha,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCscal(const size_t n,
|
|
|
|
const cl_float2 alpha,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-22 17:11:20 +02:00
|
|
|
auto status = clblast::Scal(n,
|
|
|
|
float2{alpha.s[0], alpha.s[1]},
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZscal(const size_t n,
|
|
|
|
const cl_double2 alpha,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-22 17:11:20 +02:00
|
|
|
auto status = clblast::Scal(n,
|
|
|
|
double2{alpha.s[0], alpha.s[1]},
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// COPY
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastScopy(const size_t n,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-22 17:11:20 +02:00
|
|
|
auto status = clblast::Copy<float>(n,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDcopy(const size_t n,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-22 17:11:20 +02:00
|
|
|
auto status = clblast::Copy<double>(n,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCcopy(const size_t n,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-22 17:11:20 +02:00
|
|
|
auto status = clblast::Copy<float2>(n,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZcopy(const size_t n,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-22 17:11:20 +02:00
|
|
|
auto status = clblast::Copy<double2>(n,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
2015-08-13 17:58:46 +02:00
|
|
|
// AXPY
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastSaxpy(const size_t n,
|
|
|
|
const float alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Axpy(n,
|
|
|
|
alpha,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDaxpy(const size_t n,
|
|
|
|
const double alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Axpy(n,
|
|
|
|
alpha,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCaxpy(const size_t n,
|
|
|
|
const cl_float2 alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Axpy(n,
|
2015-08-22 17:11:20 +02:00
|
|
|
float2{alpha.s[0], alpha.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZaxpy(const size_t n,
|
|
|
|
const cl_double2 alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Axpy(n,
|
2015-08-22 17:11:20 +02:00
|
|
|
double2{alpha.s[0], alpha.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
2015-09-14 16:57:00 +02:00
|
|
|
// DOT
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastSdot(const size_t n,
|
|
|
|
cl_mem dot_buffer, const size_t dot_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-14 16:57:00 +02:00
|
|
|
auto status = clblast::Dot<float>(n,
|
|
|
|
dot_buffer, dot_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDdot(const size_t n,
|
|
|
|
cl_mem dot_buffer, const size_t dot_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-14 16:57:00 +02:00
|
|
|
auto status = clblast::Dot<double>(n,
|
|
|
|
dot_buffer, dot_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// DOTU
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCdotu(const size_t n,
|
|
|
|
cl_mem dot_buffer, const size_t dot_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-14 16:57:00 +02:00
|
|
|
auto status = clblast::Dotu<float2>(n,
|
|
|
|
dot_buffer, dot_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZdotu(const size_t n,
|
|
|
|
cl_mem dot_buffer, const size_t dot_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-14 16:57:00 +02:00
|
|
|
auto status = clblast::Dotu<double2>(n,
|
|
|
|
dot_buffer, dot_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// DOTC
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCdotc(const size_t n,
|
|
|
|
cl_mem dot_buffer, const size_t dot_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-14 16:57:00 +02:00
|
|
|
auto status = clblast::Dotc<float2>(n,
|
|
|
|
dot_buffer, dot_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZdotc(const size_t n,
|
|
|
|
cl_mem dot_buffer, const size_t dot_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-14 16:57:00 +02:00
|
|
|
auto status = clblast::Dotc<double2>(n,
|
|
|
|
dot_buffer, dot_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
2016-03-25 10:00:40 +01:00
|
|
|
// NRM2
|
|
|
|
StatusCode CLBlastSnrm2(const size_t n,
|
|
|
|
cl_mem nrm2_buffer, const size_t nrm2_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Nrm2<float>(n,
|
|
|
|
nrm2_buffer, nrm2_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
StatusCode CLBlastDnrm2(const size_t n,
|
|
|
|
cl_mem nrm2_buffer, const size_t nrm2_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Nrm2<double>(n,
|
|
|
|
nrm2_buffer, nrm2_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-25 10:30:38 +01:00
|
|
|
StatusCode CLBlastScnrm2(const size_t n,
|
|
|
|
cl_mem nrm2_buffer, const size_t nrm2_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Nrm2<float2>(n,
|
|
|
|
nrm2_buffer, nrm2_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
StatusCode CLBlastDznrm2(const size_t n,
|
|
|
|
cl_mem nrm2_buffer, const size_t nrm2_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Nrm2<double2>(n,
|
|
|
|
nrm2_buffer, nrm2_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-25 10:00:40 +01:00
|
|
|
|
2016-04-14 05:44:49 +02:00
|
|
|
// ASUM
|
|
|
|
StatusCode CLBlastSasum(const size_t n,
|
|
|
|
cl_mem asum_buffer, const size_t asum_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Asum<float>(n,
|
|
|
|
asum_buffer, asum_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
StatusCode CLBlastDasum(const size_t n,
|
|
|
|
cl_mem asum_buffer, const size_t asum_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Asum<double>(n,
|
|
|
|
asum_buffer, asum_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
StatusCode CLBlastScasum(const size_t n,
|
|
|
|
cl_mem asum_buffer, const size_t asum_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Asum<float2>(n,
|
|
|
|
asum_buffer, asum_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
StatusCode CLBlastDzasum(const size_t n,
|
|
|
|
cl_mem asum_buffer, const size_t asum_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Asum<double2>(n,
|
|
|
|
asum_buffer, asum_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
2016-04-27 17:06:19 +02:00
|
|
|
// SUM
|
|
|
|
StatusCode CLBlastSsum(const size_t n,
|
|
|
|
cl_mem asum_buffer, const size_t asum_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Sum<float>(n,
|
|
|
|
asum_buffer, asum_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
StatusCode CLBlastDsum(const size_t n,
|
|
|
|
cl_mem asum_buffer, const size_t asum_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Sum<double>(n,
|
|
|
|
asum_buffer, asum_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
StatusCode CLBlastScsum(const size_t n,
|
|
|
|
cl_mem asum_buffer, const size_t asum_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Sum<float2>(n,
|
|
|
|
asum_buffer, asum_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
StatusCode CLBlastDzsum(const size_t n,
|
|
|
|
cl_mem asum_buffer, const size_t asum_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Sum<double2>(n,
|
|
|
|
asum_buffer, asum_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
2016-04-21 05:11:33 +02:00
|
|
|
// AMAX
|
|
|
|
StatusCode CLBlastiSamax(const size_t n,
|
|
|
|
cl_mem imax_buffer, const size_t imax_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Amax<float>(n,
|
|
|
|
imax_buffer, imax_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
StatusCode CLBlastiDamax(const size_t n,
|
|
|
|
cl_mem imax_buffer, const size_t imax_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Amax<double>(n,
|
|
|
|
imax_buffer, imax_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
StatusCode CLBlastiCamax(const size_t n,
|
|
|
|
cl_mem imax_buffer, const size_t imax_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Amax<float2>(n,
|
|
|
|
imax_buffer, imax_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
StatusCode CLBlastiZamax(const size_t n,
|
|
|
|
cl_mem imax_buffer, const size_t imax_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Amax<double2>(n,
|
|
|
|
imax_buffer, imax_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
2016-04-27 17:06:19 +02:00
|
|
|
// MAX
|
|
|
|
StatusCode CLBlastiSmax(const size_t n,
|
|
|
|
cl_mem imax_buffer, const size_t imax_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Max<float>(n,
|
|
|
|
imax_buffer, imax_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
StatusCode CLBlastiDmax(const size_t n,
|
|
|
|
cl_mem imax_buffer, const size_t imax_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Max<double>(n,
|
|
|
|
imax_buffer, imax_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
StatusCode CLBlastiCmax(const size_t n,
|
|
|
|
cl_mem imax_buffer, const size_t imax_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Max<float2>(n,
|
|
|
|
imax_buffer, imax_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
StatusCode CLBlastiZmax(const size_t n,
|
|
|
|
cl_mem imax_buffer, const size_t imax_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
|
|
|
auto status = clblast::Max<double2>(n,
|
|
|
|
imax_buffer, imax_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
2015-08-13 13:46:13 +02:00
|
|
|
// =================================================================================================
|
|
|
|
// BLAS level-2 (matrix-vector) routines
|
|
|
|
// =================================================================================================
|
|
|
|
|
2015-08-13 17:58:46 +02:00
|
|
|
// GEMV
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastSgemv(const Layout layout, const Transpose a_transpose,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const float alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const float beta,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Gemv(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
m, n,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
beta,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDgemv(const Layout layout, const Transpose a_transpose,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const double alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const double beta,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Gemv(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
m, n,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
beta,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCgemv(const Layout layout, const Transpose a_transpose,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const cl_float2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_float2 beta,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Gemv(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
m, n,
|
2015-08-22 17:11:20 +02:00
|
|
|
float2{alpha.s[0], alpha.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
2015-08-22 17:11:20 +02:00
|
|
|
float2{beta.s[0], beta.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZgemv(const Layout layout, const Transpose a_transpose,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const cl_double2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_double2 beta,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Gemv(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
m, n,
|
2015-08-22 17:11:20 +02:00
|
|
|
double2{alpha.s[0], alpha.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
2015-08-22 17:11:20 +02:00
|
|
|
double2{beta.s[0], beta.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
2015-09-17 17:05:45 +02:00
|
|
|
// GBMV
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastSgbmv(const Layout layout, const Transpose a_transpose,
|
|
|
|
const size_t m, const size_t n, const size_t kl, const size_t ku,
|
|
|
|
const float alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const float beta,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Gbmv(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
m, n, kl, ku,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
beta,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDgbmv(const Layout layout, const Transpose a_transpose,
|
|
|
|
const size_t m, const size_t n, const size_t kl, const size_t ku,
|
|
|
|
const double alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const double beta,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Gbmv(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
m, n, kl, ku,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
beta,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCgbmv(const Layout layout, const Transpose a_transpose,
|
|
|
|
const size_t m, const size_t n, const size_t kl, const size_t ku,
|
|
|
|
const cl_float2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_float2 beta,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Gbmv(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
m, n, kl, ku,
|
|
|
|
float2{alpha.s[0], alpha.s[1]},
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
float2{beta.s[0], beta.s[1]},
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZgbmv(const Layout layout, const Transpose a_transpose,
|
|
|
|
const size_t m, const size_t n, const size_t kl, const size_t ku,
|
|
|
|
const cl_double2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_double2 beta,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Gbmv(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
m, n, kl, ku,
|
|
|
|
double2{alpha.s[0], alpha.s[1]},
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
double2{beta.s[0], beta.s[1]},
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
2015-08-13 17:58:46 +02:00
|
|
|
// HEMV
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastChemv(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const cl_float2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_float2 beta,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Hemv(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
float2{alpha.s[0], alpha.s[1]},
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
float2{beta.s[0], beta.s[1]},
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZhemv(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const cl_double2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_double2 beta,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Hemv(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
double2{alpha.s[0], alpha.s[1]},
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
double2{beta.s[0], beta.s[1]},
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// HBMV
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastChbmv(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const cl_float2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_float2 beta,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Hbmv(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n, k,
|
|
|
|
float2{alpha.s[0], alpha.s[1]},
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
float2{beta.s[0], beta.s[1]},
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZhbmv(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const cl_double2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_double2 beta,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Hbmv(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n, k,
|
|
|
|
double2{alpha.s[0], alpha.s[1]},
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
double2{beta.s[0], beta.s[1]},
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// HPMV
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastChpmv(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const cl_float2 alpha,
|
|
|
|
const cl_mem ap_buffer, const size_t ap_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_float2 beta,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Hpmv(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
float2{alpha.s[0], alpha.s[1]},
|
|
|
|
ap_buffer, ap_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
float2{beta.s[0], beta.s[1]},
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZhpmv(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const cl_double2 alpha,
|
|
|
|
const cl_mem ap_buffer, const size_t ap_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_double2 beta,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Hpmv(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
double2{alpha.s[0], alpha.s[1]},
|
|
|
|
ap_buffer, ap_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
double2{beta.s[0], beta.s[1]},
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// SYMV
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastSsymv(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const float alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const float beta,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Symv(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
beta,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDsymv(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const double alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const double beta,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Symv(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
beta,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// SBMV
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastSsbmv(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const float alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const float beta,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Sbmv(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n, k,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
beta,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDsbmv(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const double alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const double beta,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Sbmv(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n, k,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
beta,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// SPMV
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastSspmv(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const float alpha,
|
|
|
|
const cl_mem ap_buffer, const size_t ap_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const float beta,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Spmv(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
alpha,
|
|
|
|
ap_buffer, ap_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
beta,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDspmv(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const double alpha,
|
|
|
|
const cl_mem ap_buffer, const size_t ap_offset,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const double beta,
|
|
|
|
cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Spmv(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
alpha,
|
|
|
|
ap_buffer, ap_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
beta,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// TRMV
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastStrmv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Trmv<float>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDtrmv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Trmv<double>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCtrmv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Trmv<float2>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZtrmv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Trmv<double2>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// TBMV
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastStbmv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Tbmv<float>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n, k,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDtbmv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Tbmv<double>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n, k,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCtbmv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Tbmv<float2>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n, k,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZtbmv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Tbmv<double2>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n, k,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// TPMV
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastStpmv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n,
|
|
|
|
const cl_mem ap_buffer, const size_t ap_offset,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Tpmv<float>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n,
|
|
|
|
ap_buffer, ap_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDtpmv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n,
|
|
|
|
const cl_mem ap_buffer, const size_t ap_offset,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Tpmv<double>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n,
|
|
|
|
ap_buffer, ap_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCtpmv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n,
|
|
|
|
const cl_mem ap_buffer, const size_t ap_offset,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Tpmv<float2>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n,
|
|
|
|
ap_buffer, ap_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZtpmv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n,
|
|
|
|
const cl_mem ap_buffer, const size_t ap_offset,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Tpmv<double2>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n,
|
|
|
|
ap_buffer, ap_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// TRSV
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastStrsv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Trsv<float>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDtrsv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Trsv<double>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCtrsv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Trsv<float2>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZtrsv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Trsv<double2>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// TBSV
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastStbsv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Tbsv<float>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n, k,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDtbsv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Tbsv<double>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n, k,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCtbsv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Tbsv<float2>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n, k,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZtbsv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Tbsv<double2>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n, k,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// TPSV
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastStpsv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n,
|
|
|
|
const cl_mem ap_buffer, const size_t ap_offset,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Tpsv<float>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n,
|
|
|
|
ap_buffer, ap_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDtpsv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n,
|
|
|
|
const cl_mem ap_buffer, const size_t ap_offset,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Tpsv<double>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n,
|
|
|
|
ap_buffer, ap_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCtpsv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n,
|
|
|
|
const cl_mem ap_buffer, const size_t ap_offset,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Tpsv<float2>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n,
|
|
|
|
ap_buffer, ap_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZtpsv(const Layout layout, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t n,
|
|
|
|
const cl_mem ap_buffer, const size_t ap_offset,
|
|
|
|
cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Tpsv<double2>(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
n,
|
|
|
|
ap_buffer, ap_offset,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// GER
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastSger(const Layout layout,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const float alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Ger(static_cast<clblast::Layout>(layout),
|
|
|
|
m, n,
|
|
|
|
alpha,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDger(const Layout layout,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const double alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Ger(static_cast<clblast::Layout>(layout),
|
|
|
|
m, n,
|
|
|
|
alpha,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// GERU
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCgeru(const Layout layout,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const cl_float2 alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Geru(static_cast<clblast::Layout>(layout),
|
|
|
|
m, n,
|
|
|
|
float2{alpha.s[0], alpha.s[1]},
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZgeru(const Layout layout,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const cl_double2 alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Geru(static_cast<clblast::Layout>(layout),
|
|
|
|
m, n,
|
|
|
|
double2{alpha.s[0], alpha.s[1]},
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// GERC
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCgerc(const Layout layout,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const cl_float2 alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Gerc(static_cast<clblast::Layout>(layout),
|
|
|
|
m, n,
|
|
|
|
float2{alpha.s[0], alpha.s[1]},
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZgerc(const Layout layout,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const cl_double2 alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Gerc(static_cast<clblast::Layout>(layout),
|
|
|
|
m, n,
|
|
|
|
double2{alpha.s[0], alpha.s[1]},
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// HER
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCher(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const float alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Her(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
alpha,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZher(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const double alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Her(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
alpha,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// HPR
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastChpr(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const float alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem ap_buffer, const size_t ap_offset,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Hpr(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
alpha,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
ap_buffer, ap_offset,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZhpr(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const double alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem ap_buffer, const size_t ap_offset,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Hpr(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
alpha,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
ap_buffer, ap_offset,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// HER2
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCher2(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const cl_float2 alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Her2(static_cast<clblast::Layout>(layout),
|
2015-08-13 17:58:46 +02:00
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
2015-08-22 17:11:20 +02:00
|
|
|
float2{alpha.s[0], alpha.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
2015-09-17 17:05:45 +02:00
|
|
|
a_buffer, a_offset, a_ld,
|
2015-08-13 17:58:46 +02:00
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZher2(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const cl_double2 alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Her2(static_cast<clblast::Layout>(layout),
|
2015-08-13 17:58:46 +02:00
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
2015-08-22 17:11:20 +02:00
|
|
|
double2{alpha.s[0], alpha.s[1]},
|
2015-09-17 17:05:45 +02:00
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
2015-08-13 17:58:46 +02:00
|
|
|
a_buffer, a_offset, a_ld,
|
2015-09-17 17:05:45 +02:00
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// HPR2
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastChpr2(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const cl_float2 alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_mem ap_buffer, const size_t ap_offset,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Hpr2(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
float2{alpha.s[0], alpha.s[1]},
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
ap_buffer, ap_offset,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZhpr2(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const cl_double2 alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_mem ap_buffer, const size_t ap_offset,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Hpr2(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
double2{alpha.s[0], alpha.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
2015-09-17 17:05:45 +02:00
|
|
|
ap_buffer, ap_offset,
|
2015-08-13 17:58:46 +02:00
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
2015-09-17 17:05:45 +02:00
|
|
|
// SYR
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastSsyr(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const float alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Syr(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
alpha,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDsyr(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const double alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Syr(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
alpha,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// SPR
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastSspr(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const float alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem ap_buffer, const size_t ap_offset,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Spr(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
alpha,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
ap_buffer, ap_offset,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDspr(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const double alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
cl_mem ap_buffer, const size_t ap_offset,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Spr(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
alpha,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
ap_buffer, ap_offset,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// SYR2
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastSsyr2(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const float alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Syr2(static_cast<clblast::Layout>(layout),
|
2015-08-13 17:58:46 +02:00
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
alpha,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
2015-09-17 17:05:45 +02:00
|
|
|
a_buffer, a_offset, a_ld,
|
2015-08-13 17:58:46 +02:00
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDsyr2(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const double alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Syr2(static_cast<clblast::Layout>(layout),
|
2015-08-13 17:58:46 +02:00
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
alpha,
|
2015-09-17 17:05:45 +02:00
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
2015-08-13 17:58:46 +02:00
|
|
|
a_buffer, a_offset, a_ld,
|
2015-09-17 17:05:45 +02:00
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// SPR2
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastSspr2(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const float alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_mem ap_buffer, const size_t ap_offset,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Spr2(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
alpha,
|
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
|
|
|
ap_buffer, ap_offset,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDspr2(const Layout layout, const Triangle triangle,
|
|
|
|
const size_t n,
|
|
|
|
const double alpha,
|
|
|
|
const cl_mem x_buffer, const size_t x_offset, const size_t x_inc,
|
|
|
|
const cl_mem y_buffer, const size_t y_offset, const size_t y_inc,
|
|
|
|
cl_mem ap_buffer, const size_t ap_offset,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Spr2(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
n,
|
|
|
|
alpha,
|
2015-08-13 17:58:46 +02:00
|
|
|
x_buffer, x_offset, x_inc,
|
|
|
|
y_buffer, y_offset, y_inc,
|
2015-09-17 17:05:45 +02:00
|
|
|
ap_buffer, ap_offset,
|
2015-08-13 17:58:46 +02:00
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
2015-08-13 13:46:13 +02:00
|
|
|
// =================================================================================================
|
|
|
|
// BLAS level-3 (matrix-matrix) routines
|
|
|
|
// =================================================================================================
|
|
|
|
|
|
|
|
// GEMM
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastSgemm(const Layout layout, const Transpose a_transpose, const Transpose b_transpose,
|
|
|
|
const size_t m, const size_t n, const size_t k,
|
|
|
|
const float alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
const float beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 13:46:13 +02:00
|
|
|
auto status = clblast::Gemm(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Transpose>(b_transpose),
|
2015-08-13 17:58:46 +02:00
|
|
|
m, n, k,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
|
|
|
beta,
|
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
2015-08-13 13:46:13 +02:00
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDgemm(const Layout layout, const Transpose a_transpose, const Transpose b_transpose,
|
|
|
|
const size_t m, const size_t n, const size_t k,
|
|
|
|
const double alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
const double beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 13:46:13 +02:00
|
|
|
auto status = clblast::Gemm(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Transpose>(b_transpose),
|
2015-08-13 17:58:46 +02:00
|
|
|
m, n, k,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
|
|
|
beta,
|
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
2015-08-13 13:46:13 +02:00
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCgemm(const Layout layout, const Transpose a_transpose, const Transpose b_transpose,
|
|
|
|
const size_t m, const size_t n, const size_t k,
|
|
|
|
const cl_float2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
const cl_float2 beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 13:46:13 +02:00
|
|
|
auto status = clblast::Gemm(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Transpose>(b_transpose),
|
2015-08-13 17:58:46 +02:00
|
|
|
m, n, k,
|
2015-08-22 17:11:20 +02:00
|
|
|
float2{alpha.s[0], alpha.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
2015-08-22 17:11:20 +02:00
|
|
|
float2{beta.s[0], beta.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
2015-08-13 13:46:13 +02:00
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZgemm(const Layout layout, const Transpose a_transpose, const Transpose b_transpose,
|
|
|
|
const size_t m, const size_t n, const size_t k,
|
|
|
|
const cl_double2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
const cl_double2 beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 13:46:13 +02:00
|
|
|
auto status = clblast::Gemm(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Transpose>(b_transpose),
|
2015-08-13 17:58:46 +02:00
|
|
|
m, n, k,
|
2015-08-22 17:11:20 +02:00
|
|
|
double2{alpha.s[0], alpha.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
2015-08-22 17:11:20 +02:00
|
|
|
double2{beta.s[0], beta.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// SYMM
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastSsymm(const Layout layout, const Side side, const Triangle triangle,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const float alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
const float beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Symm(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Side>(side),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
m, n,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
|
|
|
beta,
|
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDsymm(const Layout layout, const Side side, const Triangle triangle,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const double alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
const double beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Symm(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Side>(side),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
m, n,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
|
|
|
beta,
|
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCsymm(const Layout layout, const Side side, const Triangle triangle,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const cl_float2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
const cl_float2 beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Symm(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Side>(side),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
m, n,
|
2015-08-22 17:11:20 +02:00
|
|
|
float2{alpha.s[0], alpha.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
2015-08-22 17:11:20 +02:00
|
|
|
float2{beta.s[0], beta.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZsymm(const Layout layout, const Side side, const Triangle triangle,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const cl_double2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
const cl_double2 beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Symm(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Side>(side),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
m, n,
|
2015-08-22 17:11:20 +02:00
|
|
|
double2{alpha.s[0], alpha.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
2015-08-22 17:11:20 +02:00
|
|
|
double2{beta.s[0], beta.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// HEMM
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastChemm(const Layout layout, const Side side, const Triangle triangle,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const cl_float2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
const cl_float2 beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Hemm(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Side>(side),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
m, n,
|
2015-08-22 17:11:20 +02:00
|
|
|
float2{alpha.s[0], alpha.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
2015-08-22 17:11:20 +02:00
|
|
|
float2{beta.s[0], beta.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZhemm(const Layout layout, const Side side, const Triangle triangle,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const cl_double2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
const cl_double2 beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Hemm(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Side>(side),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
m, n,
|
2015-08-22 17:11:20 +02:00
|
|
|
double2{alpha.s[0], alpha.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
2015-08-22 17:11:20 +02:00
|
|
|
double2{beta.s[0], beta.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// SYRK
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastSsyrk(const Layout layout, const Triangle triangle, const Transpose a_transpose,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const float alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const float beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Syrk(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
n, k,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
beta,
|
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDsyrk(const Layout layout, const Triangle triangle, const Transpose a_transpose,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const double alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const double beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Syrk(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
n, k,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
beta,
|
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCsyrk(const Layout layout, const Triangle triangle, const Transpose a_transpose,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const cl_float2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_float2 beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Syrk(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
n, k,
|
2015-08-22 17:11:20 +02:00
|
|
|
float2{alpha.s[0], alpha.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
a_buffer, a_offset, a_ld,
|
2015-08-22 17:11:20 +02:00
|
|
|
float2{beta.s[0], beta.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZsyrk(const Layout layout, const Triangle triangle, const Transpose a_transpose,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const cl_double2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_double2 beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Syrk(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
n, k,
|
2015-08-22 17:11:20 +02:00
|
|
|
double2{alpha.s[0], alpha.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
a_buffer, a_offset, a_ld,
|
2015-08-22 17:11:20 +02:00
|
|
|
double2{beta.s[0], beta.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// HERK
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCherk(const Layout layout, const Triangle triangle, const Transpose a_transpose,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const float alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const float beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Herk(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
n, k,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
beta,
|
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZherk(const Layout layout, const Triangle triangle, const Transpose a_transpose,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const double alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const double beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Herk(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
n, k,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
beta,
|
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// SYR2K
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastSsyr2k(const Layout layout, const Triangle triangle, const Transpose ab_transpose,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const float alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
const float beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Syr2k(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(ab_transpose),
|
|
|
|
n, k,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
|
|
|
beta,
|
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDsyr2k(const Layout layout, const Triangle triangle, const Transpose ab_transpose,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const double alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
const double beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Syr2k(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(ab_transpose),
|
|
|
|
n, k,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
|
|
|
beta,
|
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCsyr2k(const Layout layout, const Triangle triangle, const Transpose ab_transpose,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const cl_float2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
const cl_float2 beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Syr2k(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(ab_transpose),
|
|
|
|
n, k,
|
2015-08-22 17:11:20 +02:00
|
|
|
float2{alpha.s[0], alpha.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
2015-08-22 17:11:20 +02:00
|
|
|
float2{beta.s[0], beta.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZsyr2k(const Layout layout, const Triangle triangle, const Transpose ab_transpose,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const cl_double2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
const cl_double2 beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Syr2k(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(ab_transpose),
|
|
|
|
n, k,
|
2015-08-22 17:11:20 +02:00
|
|
|
double2{alpha.s[0], alpha.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
2015-08-22 17:11:20 +02:00
|
|
|
double2{beta.s[0], beta.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// HER2K
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCher2k(const Layout layout, const Triangle triangle, const Transpose ab_transpose,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const cl_float2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
const float beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Her2k(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(ab_transpose),
|
|
|
|
n, k,
|
2015-08-22 17:11:20 +02:00
|
|
|
float2{alpha.s[0], alpha.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
|
|
|
beta,
|
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZher2k(const Layout layout, const Triangle triangle, const Transpose ab_transpose,
|
|
|
|
const size_t n, const size_t k,
|
|
|
|
const cl_double2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
const cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
const double beta,
|
|
|
|
cl_mem c_buffer, const size_t c_offset, const size_t c_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Her2k(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(ab_transpose),
|
|
|
|
n, k,
|
2015-08-22 17:11:20 +02:00
|
|
|
double2{alpha.s[0], alpha.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
|
|
|
beta,
|
|
|
|
c_buffer, c_offset, c_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
// TRMM
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastStrmm(const Layout layout, const Side side, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const float alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Trmm(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Side>(side),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
m, n,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDtrmm(const Layout layout, const Side side, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const double alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Trmm(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Side>(side),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
m, n,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCtrmm(const Layout layout, const Side side, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const cl_float2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Trmm(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Side>(side),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
m, n,
|
2015-08-22 17:11:20 +02:00
|
|
|
float2{alpha.s[0], alpha.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZtrmm(const Layout layout, const Side side, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const cl_double2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-08-13 17:58:46 +02:00
|
|
|
auto status = clblast::Trmm(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Side>(side),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
m, n,
|
2015-08-22 17:11:20 +02:00
|
|
|
double2{alpha.s[0], alpha.s[1]},
|
2015-08-13 17:58:46 +02:00
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
|
|
|
queue, event);
|
2015-08-13 13:46:13 +02:00
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
2015-09-17 17:05:45 +02:00
|
|
|
// TRSM
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastStrsm(const Layout layout, const Side side, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const float alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Trsm(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Side>(side),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
m, n,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastDtrsm(const Layout layout, const Side side, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const double alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Trsm(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Side>(side),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
m, n,
|
|
|
|
alpha,
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastCtrsm(const Layout layout, const Side side, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const cl_float2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Trsm(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Side>(side),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
m, n,
|
|
|
|
float2{alpha.s[0], alpha.s[1]},
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
2016-03-23 20:49:28 +01:00
|
|
|
StatusCode CLBlastZtrsm(const Layout layout, const Side side, const Triangle triangle, const Transpose a_transpose, const Diagonal diagonal,
|
|
|
|
const size_t m, const size_t n,
|
|
|
|
const cl_double2 alpha,
|
|
|
|
const cl_mem a_buffer, const size_t a_offset, const size_t a_ld,
|
|
|
|
cl_mem b_buffer, const size_t b_offset, const size_t b_ld,
|
|
|
|
cl_command_queue* queue, cl_event* event) {
|
2015-09-17 17:05:45 +02:00
|
|
|
auto status = clblast::Trsm(static_cast<clblast::Layout>(layout),
|
|
|
|
static_cast<clblast::Side>(side),
|
|
|
|
static_cast<clblast::Triangle>(triangle),
|
|
|
|
static_cast<clblast::Transpose>(a_transpose),
|
|
|
|
static_cast<clblast::Diagonal>(diagonal),
|
|
|
|
m, n,
|
|
|
|
double2{alpha.s[0], alpha.s[1]},
|
|
|
|
a_buffer, a_offset, a_ld,
|
|
|
|
b_buffer, b_offset, b_ld,
|
|
|
|
queue, event);
|
|
|
|
return static_cast<StatusCode>(status);
|
|
|
|
}
|
|
|
|
|
2015-08-13 13:46:13 +02:00
|
|
|
// =================================================================================================
|
2016-04-27 16:02:13 +02:00
|
|
|
|
|
|
|
// Clears the cache of stored program binaries
|
|
|
|
StatusCode CLBlastClearCompiledProgramCache() {
|
|
|
|
return static_cast<StatusCode>(clblast::ClearCompiledProgramCache());
|
|
|
|
}
|
|
|
|
|
|
|
|
// =================================================================================================
|