You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ubuntu 22.04
ndk version 25.1.8937393
taichi commit 52b24f3
I have built android taichi with the scripts/build-taichi-android.sh (-DTI_WITH_VULKAN=ON).
Here is the code:
app.py
import numpy as np
import taichi as ti
ti.init(arch=ti.vulkan)
v_arr = np.zeros(100).astype(np.float32)
@ti.kernel
def update_values(v: ti.types.ndarray(ndim=1)):
for i in range(100):
v[i] = 15
m = ti.aot.Module()
m.add_kernel(update_values, template_args={"v": v_arr})
m.archive("update_values.tcm")
[Taichi] version 1.7.0, llvm 15.0.4, commit 2fd24490, linux, python 3.10.12
[Taichi] Starting on arch=x64
-- The C compiler identification is Clang 14.0.6
-- The CXX compiler identification is Clang 14.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /path/to/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /path/to/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: /path/to/taichi_example/test_aot_issue/build
[ 50%] Building CXX object CMakeFiles/update_val.dir/app.cpp.o
[100%] Linking CXX executable update_val
[100%] Built target update_val
On device in the folder there is the so and the executable.
And I was using inconsistent architectures which caused bad keys when reading the module did not see at first in the log, also module names were wrong.
here is an updated example just in case someone would came across this test_aot_issue.zip
Hi! Thanks for your work.
I would like to use Taichi with android. Based on the tests I am trying to create a very simple initial example, but I am getting all zeros.
https://github.com/taichi-dev/taichi/blob/52b24f3e09c093610b1ecf69b5e33cbc66b7bd6d/tests/cpp/aot/python_scripts/shared_array_aot_test_.py
and
https://github.com/taichi-dev/taichi/blob/52b24f3e09c093610b1ecf69b5e33cbc66b7bd6d/c_api/tests/c_api_aot_test.cpp
ubuntu 22.04
ndk version 25.1.8937393
taichi commit 52b24f3
I have built android taichi with the scripts/build-taichi-android.sh (-DTI_WITH_VULKAN=ON).
Here is the code:
app.py
app.cpp
CMakeLists.txt
the command:
python app.py
cmake -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_TOOLCHAIN_FILE=$NDK_TOOLCHAIN_FILE \ -DANDROID_PLATFORM=33 \ -DANDROID_ABI=$ANDROID_ABI \ -Bbuild \ -S.
cmake --build build -j 4
the log of running python and cmake:
On device in the folder there is the so and the executable.
The output:
The result is the same with cpu gles and vulkan (changed in both python and cpp)
The text was updated successfully, but these errors were encountered: