Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions python/tvm/contrib/cc.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ def create_shared(output, objects, options=None, cc=None, cwd=None, ccache_env=N

if _is_linux_like():
_linux_compile(output, objects, options, cc, cwd, ccache_env, compile_shared=True)
elif _is_windows_like():
_windows_compile(output, objects, options, cwd, ccache_env)
elif _is__like():
__compile(output, objects, options, cwd, ccache_env)
else:
raise ValueError("Unsupported platform")

Expand Down Expand Up @@ -173,8 +173,8 @@ def create_executable(output, objects, options=None, cc=None, cwd=None, ccache_e

if _is_linux_like():
_linux_compile(output, objects, options, cc, cwd, ccache_env)
elif _is_windows_like():
_windows_compile(output, objects, options, cwd, ccache_env)
elif _is__like():
__compile(output, objects, options, cwd, ccache_env)
else:
raise ValueError("Unsupported platform")

Expand Down Expand Up @@ -372,8 +372,11 @@ def _linux_compile(


def _windows_compile(output, objects, options, cwd=None, ccache_env=None):
cmd = ["clang"]
compiler = os.getenv("TVM_WIN_CC", default="clang")
win_target = os.getenv("TVM_WIN_TARGET", default="x86_64")
cmd = [compiler]
cmd += ["-O2"]
cmd += ["--target=" + win_target]

if output.endswith(".so") or output.endswith(".dll"):
cmd += ["-shared"]
Expand Down
13 changes: 10 additions & 3 deletions python/tvm/dlight/gpu/gemv.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,9 @@ def apply(
TS, TR = 8, 64
else:
TS, TR = 1, 64
elif target.kind.name == "opencl" and "android" in str(target.host):
elif target.kind.name == "opencl" and (
("android" in str(target.host)) or ("adreno" in str(target.attrs))
):
TAG_S, TAG_R = "threadIdx.x", "threadIdx.y"
VEC_C = 8
LOAD_V_SHARED = False
Expand Down Expand Up @@ -686,7 +688,9 @@ def apply(
DEC_PACK = 8
SCALE_PACK = 4

if target.kind.name == "opencl" and "android" in str(target.host):
if target.kind.name == "opencl" and (
("android" in str(target.host)) or ("adreno" in str(target.attrs))
):
TAG_S, TAG_R = "threadIdx.x", "threadIdx.y"
VEC_C = 8
UNROLL = 8
Expand Down Expand Up @@ -756,7 +760,10 @@ def sch_outer_reduction_fallback( # pylint: disable=too-many-arguments, invalid
):
"""Schedule the outer reduction block."""
# NOTE: Only Android is supported so far
if not (target.kind.name == "opencl" and "android" in str(target.host)):
if not (
target.kind.name == "opencl"
and (("android" in str(target.host)) or ("adreno" in str(target.attrs)))
):
return None
batch, s, r, c = sch.get_loops(block)
len_s = get_extent(sch, s)
Expand Down