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")
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\\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\\cuda" GLOB "src/runtime/cuda/*.cc")
tvm_source_group("Source\\runtime\\opencl" GLOB "src/runtime/opencl/*.cc")
......@@ -66,6 +67,7 @@ file(GLOB COMPILER_SRCS
src/codegen/stack_vm/*.cc
src/lang/*.cc
src/pass/*.cc
src/op/*.cc
src/schedule/*.cc
)
file(GLOB_RECURSE HALIDEIR_SRCS HalideIR/src/*.cpp)
......
......@@ -375,7 +375,7 @@ TVM_DLL int TVMFuncListGlobalNames(int *out_size,
* \return 0 when success, -1 when failure happens
*/
TVM_DLL int TVMArrayAlloc(const tvm_index_t* shape,
tvm_index_t ndim,
int ndim,
TVMType dtype,
TVMContext ctx,
TVMArrayHandle* out);
......
......@@ -716,8 +716,9 @@ template<typename... Args>
inline TVMRetValue PackedFunc::operator()(Args&& ...args) const {
auto targs = std::make_tuple(std::forward<Args>(args)...);
const int kNumArgs = sizeof...(Args);
TVMValue values[kNumArgs];
int type_codes[kNumArgs];
const int kArraySize = kNumArgs > 0 ? kNumArgs : 1;
TVMValue values[kArraySize];
int type_codes[kArraySize];
for_each(targs, TVMArgsSetter(values, type_codes));
TVMRetValue rv;
body_(TVMArgs(values, type_codes, kNumArgs), &rv);
......
......@@ -63,7 +63,7 @@ def compile_source(code, target="ptx", arch=None,
if proc.returncode != 0:
sys.stderr.write("Compilation error:\n")
sys.stderr.write(out)
sys.stderr.write(str(out))
sys.stderr.flush()
cubin = None
else:
......
......@@ -95,7 +95,7 @@ std::string CodeGenC::GetBufferRef(
if (alloc_storage_scope_.count(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 (!HandleTypeMatch(buffer, t) || is_vol) {
os << "((";
......
......@@ -199,7 +199,7 @@ class StageSplitter : public IRMutator {
private:
// Build the stage.
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);
// The Substitute
Map<Var, Expr> subst;
......
......@@ -310,7 +310,7 @@ int TVMFuncCreateFromCFunc(TVMPackedCFunc func,
}
int TVMArrayAlloc(const tvm_index_t* shape,
tvm_index_t ndim,
int ndim,
TVMType dtype,
TVMContext ctx,
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