-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy pathRewriterDeviceSpmv.cpp
More file actions
37 lines (34 loc) · 1.71 KB
/
RewriterDeviceSpmv.cpp
File metadata and controls
37 lines (34 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//===--------------- RewriterDeviceSpmv.cpp -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "CallExprRewriterCUB.h"
#include "RuleInfra/CallExprRewriterCommon.h"
#include "RuleInfra/MapNames.h"
using namespace clang::dpct;
RewriterMap dpct::createDeviceSpmvRewriterMap() {
return RewriterMap{
// cub::DeviceSpmv::CsrMV
CONDITIONAL_FACTORY_ENTRY(
CheckCubRedundantFunctionCall(),
REMOVE_API_FACTORY_ENTRY("cub::DeviceSpmv::CsrMV"),
HEADER_INSERT_FACTORY(
HeaderType::HT_DPCT_SPBLAS_Utils,
REMOVE_CUB_TEMP_STORAGE_FACTORY(CONDITIONAL_FACTORY_ENTRY(
makeCheckAnd(CheckArgCount(11, std::greater_equal<>(),
/* IncludeDefaultArg */ false),
makeCheckNot(CheckArgIsDefaultCudaStream(10))),
CALL_FACTORY_ENTRY(
"cub::DeviceSpmv::CsrMV",
CALL(MapNames::getLibraryHelperNamespace() + "sparse::csrmv",
STREAM(10), ARG(2), ARG(3), ARG(4), ARG(5), ARG(6),
ARG(7), ARG(8), ARG(9))),
CALL_FACTORY_ENTRY(
"cub::DeviceSpmv::CsrMV",
CALL(MapNames::getLibraryHelperNamespace() + "sparse::csrmv",
QUEUESTR, ARG(2), ARG(3), ARG(4), ARG(5), ARG(6),
ARG(7), ARG(8), ARG(9)))))))};
}