Skip to content

Commit

Permalink
merge with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
archibate committed Feb 26, 2020
2 parents 62e0a24 + 3d5f157 commit e793657
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion taichi/profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class CUDAProfiler : public ProfilerBase {
} // namespace

std::unique_ptr<ProfilerBase> make_profiler(Arch arch) {
if (arch == Arch::x64 || arch == Arch::metal || arch == Arch::opengl) {
if (arch == Arch::x64 || arch == Arch::arm64 || arch == Arch::metal || arch == Arch::opengl) {
return std::make_unique<DefaultProfiler>(arch);
} else if (arch == Arch::cuda) {
return std::make_unique<CUDAProfiler>();
Expand Down
11 changes: 3 additions & 8 deletions test_abs.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import taichi as ti


@ti.all_archs
def test_abs():
x = ti.var(ti.f32)
y = ti.var(ti.f32)

N = 16

@ti.layout
def place():
ti.root.dense(ti.i, N).place(x)
ti.root.dense(ti.i, N).place(y)
ti.root.lazy_grad()
ti.root.dense(ti.i, N).place(x)
ti.root.dense(ti.i, N).place(y)
ti.root.lazy_grad()

@ti.kernel
def func():
Expand All @@ -36,5 +33,3 @@ def sgn(x):
for i in range(N):
assert x[i] == abs(y[i])
assert y.grad[i] == sgn(y[i])

test_abs()

0 comments on commit e793657

Please sign in to comment.