From ccad7b945158c0aeb4424cc1e2dc29015df0ae09 Mon Sep 17 00:00:00 2001 From: Yuanming Hu Date: Wed, 11 Nov 2020 14:02:59 -0500 Subject: [PATCH 1/2] [cuda] Fix ti.random(dtype=ti.f64) --- taichi/runtime/llvm/runtime.cpp | 2 +- tests/python/test_random.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/taichi/runtime/llvm/runtime.cpp b/taichi/runtime/llvm/runtime.cpp index 8b3b6365f6a88..2f1d4e2f31f8d 100644 --- a/taichi/runtime/llvm/runtime.cpp +++ b/taichi/runtime/llvm/runtime.cpp @@ -1466,7 +1466,7 @@ f32 cuda_rand_f32(Context *context) { return cuda_rand_u32(context) * (1.0f / 4294967296.0f); } -f32 cuda_rand_f64(Context *context) { +f64 cuda_rand_f64(Context *context) { return cuda_rand_f32(context); } diff --git a/tests/python/test_random.py b/tests/python/test_random.py index 56c50598dd5d0..aa6d79ab554ce 100644 --- a/tests/python/test_random.py +++ b/tests/python/test_random.py @@ -105,3 +105,12 @@ def gen(i: ti.i32): count += 1 if x[i] == x[i - 1] else 0 assert count <= n * 0.15 + + +@ti.test(arch=[ti.cpu, ti.cuda]) +def test_random_f64(): + @ti.kernel + def foo() -> ti.f64: + return ti.random(dtype=ti.f64) + + foo() From 5485388e9e0f1e5187c70ce9443b406455b40186 Mon Sep 17 00:00:00 2001 From: Yuanming Hu Date: Wed, 11 Nov 2020 14:13:45 -0500 Subject: [PATCH 2/2] update PR template --- .github/pull_request_template.md | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 7b39f7902152f..b09a665547e76 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -2,22 +2,19 @@ Related issue = # +- If the PR does not belong to any existing issue, free to leave it blank. +--> [[Click here for the format server]](http://kun.csail.mit.edu:31415/)