Skip to content

Commit 8a19761

Browse files
authored
migrate backends/cuda/runtime/shims/tests (fbcode-only CUDA tests)
Differential Revision: D109082049 Pull Request resolved: pytorch#21427
1 parent 0f79fbd commit 8a19761

3 files changed

Lines changed: 16 additions & 9 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Any targets that should be shared between fbcode and xplat must be defined in
2+
# targets.bzl.
3+
4+
load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode")
5+
load(":targets.bzl", "define_common_targets")
6+
7+
oncall("executorch")
8+
9+
define_common_targets(is_fbcode = is_fbcode())

‎backends/cuda/runtime/shims/tests/TARGETS‎

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎backends/cuda/runtime/shims/tests/targets.bzl‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,16 @@ def cuda_shim_cpp_unittest(name):
2525
),
2626
)
2727

28-
def define_common_targets():
28+
def define_common_targets(is_fbcode = False):
2929
"""Defines targets that should be shared between fbcode and xplat.
3030
31-
The directory containing this targets.bzl file should also contain both
32-
TARGETS and BUCK files that call this function.
31+
Uses fbcode-only macros (cpp_unittest, re_test_utils) and kwargs
32+
(keep_gpu_sections), so we early-return outside fbcode to preserve
33+
pre-migration behavior (this dir was originally TARGETS-only).
3334
"""
35+
if not is_fbcode:
36+
return
37+
3438
cuda_shim_cpp_unittest("aoti_torch_empty_strided")
3539
cuda_shim_cpp_unittest("aoti_torch_delete_tensor_object")
3640
cuda_shim_cpp_unittest("aoti_torch_create_tensor_from_blob_v2")

0 commit comments

Comments
 (0)