Skip to content

Commit 2734d04

Browse files
authoredSep 2, 2022
[Adreno] Define memory_info for global.texture* (apache#12647)
There are now many warnings in the tuning process about undefined memory information when using textures. A definition is required as textures* are tagged.
1 parent 4ed6564 commit 2734d04

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed
 

‎include/tvm/target/target_info.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ namespace tvm {
3737
class MemoryInfoNode : public Object {
3838
public:
3939
/*! \brief The addressable unit */
40-
int unit_bits;
40+
int64_t unit_bits;
4141
/*! \brief Maximum number of bits supported in the memory */
42-
int max_num_bits;
42+
int64_t max_num_bits;
4343
/*! \brief maximum number of bits to be used in simd op */
44-
int max_simd_bits;
44+
int64_t max_simd_bits;
4545
/*!
4646
* \brief head address of the buffer, if visible to CPU
4747
* This address can be None.

‎python/tvm/topi/adreno/utils.py

+14
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import tvm
2121
import numpy
2222
from tvm import te
23+
from tvm._ffi.registry import register_func
2324
from tvm.topi.utils import simplify
2425
from tvm.topi import nn
2526
from tvm.autotvm.task.space import SplitEntity
@@ -571,6 +572,19 @@ def get_texture_storage(shape):
571572
return "global.texture-weight"
572573

573574

575+
@register_func("tvm.info.mem.global.texture")
576+
@register_func("tvm.info.mem.global.texture-nhwc")
577+
@register_func("tvm.info.mem.global.texture-weight")
578+
def mem_info_global_texture_variants():
579+
return tvm.ir.make_node(
580+
"MemoryInfo",
581+
unit_bits=16,
582+
max_num_bits=16384 * 16384 * 4 * 32,
583+
max_simd_bits=4 * 32,
584+
head_address=None,
585+
)
586+
587+
574588
def infer_tile_size(data, layout):
575589
"""Compute the tile size for Winograd algorithm
576590

0 commit comments

Comments
 (0)
Please sign in to comment.