Comments (8)
After you build the function, you can get the opencl source code.
s = tvm.create_schedule(C.op)
func = tvm.build(s, [A, B, C], target='opencl')
src = func.imported_modules[0].get_source()
Variable src
is a string of opencl code. Then you can write it to a file.
See the tutorial (http://docs.tvmlang.org/tutorials/get_started.html) for more explanation on this example.
For the convolution example in my blog post, I get the source code by uncommenting line 135
tvm-mali/layer-test/test_conv2d.py
Lines 131 to 135 in 8b0ba39
from tvm-mali.
@merrymercy
Thanks
How could I get opencl kernel after nnvm.compiler.build?
from tvm-mali.
After this block
tvm-mali/mali_imagenet_bench.py
Lines 32 to 35 in 90395b5
insert this line
print(lib.imported_modules[0].get_source())
from tvm-mali.
Thanks a lot!
What mean is lib.imported_modules?
And how to get host runtime source code too?
from tvm-mali.
lib
is the host module (llvm ir)
lib.imported_modules
is the device module (cuda, opencl)
lib.get_source() # get host llvm ir
lib.imported_modules[0].get_source() # get opencl/cuda source
from tvm-mali.
There is no way to get host c code, only LLVM IR, right?
export_library does not generate opencl runtime code, right?
from tvm-mali.
Is there any document to explain how this host library and opencl are executed on target platform?
from tvm-mali.
- TVM translate its Halide IR to LLVM IR directly, so there is no host c code.
nnvm.compiler.build
generates both host code and opencl code.export_library
only saves them to files
Since the original question is answered, we can close this issue for now and open new issue on tvm repo.
from tvm-mali.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tvm-mali.