Commit be1a29ed by Tianqi Chen Committed by GitHub

[CMAKE] Windows support upgrade (#125)

* [CMAKE] Windows support upgrade

* Fix lint
parent c154fcdc
...@@ -55,6 +55,7 @@ tvm_source_group("Source\\codegen" GLOB "src/codegen/*.cc") ...@@ -55,6 +55,7 @@ tvm_source_group("Source\\codegen" GLOB "src/codegen/*.cc")
tvm_source_group("Source\\codegen\\llvm" GLOB "src/codegen/llvm/*.cc") tvm_source_group("Source\\codegen\\llvm" GLOB "src/codegen/llvm/*.cc")
tvm_source_group("Source\\codegen\\stack_vm" GLOB "src/codegen/stack_vm/*.cc") tvm_source_group("Source\\codegen\\stack_vm" GLOB "src/codegen/stack_vm/*.cc")
tvm_source_group("Source\\pass" GLOB "src/pass/*.cc") tvm_source_group("Source\\pass" GLOB "src/pass/*.cc")
tvm_source_group("Source\\op" GLOB "src/op/*.cc")
tvm_source_group("Source\\runtime" GLOB "src/runtime/*.cc") tvm_source_group("Source\\runtime" GLOB "src/runtime/*.cc")
tvm_source_group("Source\\runtime\\cuda" GLOB "src/runtime/cuda/*.cc") tvm_source_group("Source\\runtime\\cuda" GLOB "src/runtime/cuda/*.cc")
tvm_source_group("Source\\runtime\\opencl" GLOB "src/runtime/opencl/*.cc") tvm_source_group("Source\\runtime\\opencl" GLOB "src/runtime/opencl/*.cc")
...@@ -66,6 +67,7 @@ file(GLOB COMPILER_SRCS ...@@ -66,6 +67,7 @@ file(GLOB COMPILER_SRCS
src/codegen/stack_vm/*.cc src/codegen/stack_vm/*.cc
src/lang/*.cc src/lang/*.cc
src/pass/*.cc src/pass/*.cc
src/op/*.cc
src/schedule/*.cc src/schedule/*.cc
) )
file(GLOB_RECURSE HALIDEIR_SRCS HalideIR/src/*.cpp) file(GLOB_RECURSE HALIDEIR_SRCS HalideIR/src/*.cpp)
......
...@@ -375,7 +375,7 @@ TVM_DLL int TVMFuncListGlobalNames(int *out_size, ...@@ -375,7 +375,7 @@ TVM_DLL int TVMFuncListGlobalNames(int *out_size,
* \return 0 when success, -1 when failure happens * \return 0 when success, -1 when failure happens
*/ */
TVM_DLL int TVMArrayAlloc(const tvm_index_t* shape, TVM_DLL int TVMArrayAlloc(const tvm_index_t* shape,
tvm_index_t ndim, int ndim,
TVMType dtype, TVMType dtype,
TVMContext ctx, TVMContext ctx,
TVMArrayHandle* out); TVMArrayHandle* out);
......
...@@ -716,8 +716,9 @@ template<typename... Args> ...@@ -716,8 +716,9 @@ template<typename... Args>
inline TVMRetValue PackedFunc::operator()(Args&& ...args) const { inline TVMRetValue PackedFunc::operator()(Args&& ...args) const {
auto targs = std::make_tuple(std::forward<Args>(args)...); auto targs = std::make_tuple(std::forward<Args>(args)...);
const int kNumArgs = sizeof...(Args); const int kNumArgs = sizeof...(Args);
TVMValue values[kNumArgs]; const int kArraySize = kNumArgs > 0 ? kNumArgs : 1;
int type_codes[kNumArgs]; TVMValue values[kArraySize];
int type_codes[kArraySize];
for_each(targs, TVMArgsSetter(values, type_codes)); for_each(targs, TVMArgsSetter(values, type_codes));
TVMRetValue rv; TVMRetValue rv;
body_(TVMArgs(values, type_codes, kNumArgs), &rv); body_(TVMArgs(values, type_codes, kNumArgs), &rv);
......
...@@ -63,7 +63,7 @@ def compile_source(code, target="ptx", arch=None, ...@@ -63,7 +63,7 @@ def compile_source(code, target="ptx", arch=None,
if proc.returncode != 0: if proc.returncode != 0:
sys.stderr.write("Compilation error:\n") sys.stderr.write("Compilation error:\n")
sys.stderr.write(out) sys.stderr.write(str(out))
sys.stderr.flush() sys.stderr.flush()
cubin = None cubin = None
else: else:
......
...@@ -95,7 +95,7 @@ std::string CodeGenC::GetBufferRef( ...@@ -95,7 +95,7 @@ std::string CodeGenC::GetBufferRef(
if (alloc_storage_scope_.count(buffer)) { if (alloc_storage_scope_.count(buffer)) {
scope = alloc_storage_scope_.at(buffer); scope = alloc_storage_scope_.at(buffer);
} }
bool is_vol = volatile_buf_.count(buffer); bool is_vol = volatile_buf_.count(buffer) != 0;
if (t.lanes() == 1) { if (t.lanes() == 1) {
if (!HandleTypeMatch(buffer, t) || is_vol) { if (!HandleTypeMatch(buffer, t) || is_vol) {
os << "(("; os << "((";
......
...@@ -199,7 +199,7 @@ class StageSplitter : public IRMutator { ...@@ -199,7 +199,7 @@ class StageSplitter : public IRMutator {
private: private:
// Build the stage. // Build the stage.
Stmt BuildStage(Stmt body, NodeRef target) { Stmt BuildStage(Stmt body, NodeRef target) {
int stage_index = static_cast<size_t>(stages_.size()); int stage_index = static_cast<int>(stages_.size());
std::string stage_suffix = "." + std::to_string(stage_index); std::string stage_suffix = "." + std::to_string(stage_index);
// The Substitute // The Substitute
Map<Var, Expr> subst; Map<Var, Expr> subst;
......
...@@ -310,7 +310,7 @@ int TVMFuncCreateFromCFunc(TVMPackedCFunc func, ...@@ -310,7 +310,7 @@ int TVMFuncCreateFromCFunc(TVMPackedCFunc func,
} }
int TVMArrayAlloc(const tvm_index_t* shape, int TVMArrayAlloc(const tvm_index_t* shape,
tvm_index_t ndim, int ndim,
TVMType dtype, TVMType dtype,
TVMContext ctx, TVMContext ctx,
TVMArrayHandle* out) { TVMArrayHandle* out) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment