Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit a9989f8

Browse files
Placeholder for ExecutionEngine<CpuTcExecutor> test
1 parent 93f2de8 commit a9989f8

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/test_mapper_llvm.cc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,14 @@
2020

2121
#include <ATen/ATen.h>
2222

23+
#include "tc/aten/utils.h"
24+
#include "tc/core/cpu/cpu_tc_executor.h"
25+
#include "tc/core/execution_engine.h"
26+
#include "tc/core/mapping_options.h"
2327
#include "tc/core/polyhedral/codegen_llvm.h"
2428
#include "tc/core/polyhedral/llvm_jit.h"
2529
#include "tc/core/polyhedral/scop.h"
30+
#include "tc/core/scope_guard.h"
2631

2732
#include "test_harness_aten.h"
2833

@@ -61,6 +66,29 @@ def fun(float(N, M) A, float(N, M) B) -> (C) {
6166
checkRtol(Cc - C, {A, B}, N * M);
6267
}
6368

69+
TEST(LLVMCodegen, DISABLED_BasicExecutionEngine) {
70+
string tc = R"TC(
71+
def fun(float(N, M) A, float(N, M) B) -> (C) {
72+
C(i, j) = A(i, j) + B(i, j)
73+
}
74+
)TC";
75+
76+
auto N = 40;
77+
auto M = 24;
78+
79+
at::Tensor A = at::CPU(at::kFloat).rand({N, M});
80+
at::Tensor B = at::CPU(at::kFloat).rand({N, M});
81+
at::Tensor C = at::CPU(at::kFloat).rand({N, M});
82+
83+
ExecutionEngine<CpuTcExecutor> engine;
84+
engine.define(tc);
85+
auto options = tc::MappingOptions::makeNaiveMappingOptions();
86+
auto inputDLTensorsPair = toConstDlpackTensors({A, B});
87+
ScopeGuard g([&]() { deleteDlmTensors(inputDLTensorsPair.second); });
88+
engine.compile(
89+
"fun", inputDLTensorsPair.first, options.toProtobufSerializedString());
90+
}
91+
6492
TEST(LLVMCodegen, MultiStmt) {
6593
string tc = R"TC(
6694
def fun(float(N, M, K, L) A, float(N, M) B, float(N, M) C, float(N, M) D)

0 commit comments

Comments
 (0)