MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / setup

Method setup

bench/python/all_ops/op_cache_limit.py:41–57  ·  view source on GitHub ↗
(self, input, new_cache_limit, low, high)

Source from the content-addressed store, hash-verified

39# consistent numbers.
40class BaseOpCacheLimit(AbstractOpBase):
41 def setup(self, input, new_cache_limit, low, high):
42 super().setup(input)
43
44 # make this benchmark compatible with older cvcuda versions
45 if hasattr(cvcuda, "set_cache_limit_inbytes"):
46 cvcuda.set_cache_limit_inbytes(new_cache_limit)
47
48 # We don't have access to the outer benchmark iterations (default=10), so we have to create our own
49 # counter.
50 self.max_iter_outer = 10
51 self.iter_outer = 0
52
53 # Number of "random" tensors created per benchmarked run
54 self.n_tensors = 20
55 self.hw = torch.randint(
56 low=low, high=high, size=(self.max_iter_outer, 2, self.n_tensors)
57 )
58
59 def run(self, input):
60 # If we exceed the outer bench iterations, we return.

Callers 3

setupMethod · 0.45
setupMethod · 0.45
setupMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected