Commit 977896cb by Haichen Shen Committed by Tianqi Chen

[Bugfix] Fix type code error for StringImm (#3050)

parent f4fa0328
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the * to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance * "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at * with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, * Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an * software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
...@@ -251,6 +251,9 @@ class BuiltinLower : public IRMutator { ...@@ -251,6 +251,9 @@ class BuiltinLower : public IRMutator {
stack_value_, static_cast<int>(arg_stack_begin + i - 1), stack_value_, static_cast<int>(arg_stack_begin + i - 1),
intrinsic::kTVMValueContent, arg)); intrinsic::kTVMValueContent, arg));
int arg_tcode = api_type.code(); int arg_tcode = api_type.code();
if (api_type.is_handle() && arg.as<StringImm>()) {
arg_tcode = kStr;
}
if (IsArrayHandle(arg)) arg_tcode = kArrayHandle; if (IsArrayHandle(arg)) arg_tcode = kArrayHandle;
prep_seq_.emplace_back( prep_seq_.emplace_back(
Store::make(stack_tcode_, Store::make(stack_tcode_,
......
...@@ -29,7 +29,6 @@ def test_min_repeat_ms(): ...@@ -29,7 +29,6 @@ def test_min_repeat_ms():
def my_debug(filename): def my_debug(filename):
"""one call lasts for 100 ms and writes one character to a file""" """one call lasts for 100 ms and writes one character to a file"""
time.sleep(0.1) time.sleep(0.1)
filename = ctypes.c_char_p(filename.value).value
with open(filename, "a") as fout: with open(filename, "a") as fout:
fout.write("c") fout.write("c")
......
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