3namespace details::linear_system
6 MUDA_INLINE
void dot_common_check(CDenseVectorView<T> x, CDenseVectorView<T> y)
8 MUDA_ASSERT(x.data() && y.data(),
"x.data() and y.data() should not be nullptr");
9 MUDA_ASSERT(x.size() / x.inc() == y.size() / y.inc(),
10 "x (size=%lld, inc=%d) should be the same as y (size=%lld, inc=%d)",
20void LinearSystemContext::dot(CDenseVectorView<T> x, CDenseVectorView<T> y, T* result)
22 set_pointer_mode_host();
23 details::linear_system::dot_common_check(x, y);
25 auto type = cuda_data_type<T>();
26 auto size = x.size() / x.inc();
28 checkCudaErrors(cublasDotEx(
29 cublas(), size, x.data(), type, x.inc(), y.data(), type, y.inc(), result, type, type));
33T LinearSystemContext::dot(CDenseVectorView<T> x, CDenseVectorView<T> y)
42void LinearSystemContext::dot(CDenseVectorView<T> x, CDenseVectorView<T> y, VarView<T> result)
44 set_pointer_mode_device();
45 details::linear_system::dot_common_check(x, y);
47 auto type = cuda_data_type<T>();
48 auto size = x.size() / x.inc();
51 checkCudaErrors(cublasDotEx(
52 cublas(), size, x.data(), type, x.inc(), y.data(), type, y.inc(), result.data(), type, type));