-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add NVRTC_SKIP_KERNEL_RUN tag to compile, but skip running NVRTC test (…
…#434) Some kernels using TMA need some host code to run as well. In addition, they need the device symbols to be accessible from host code. This turns out to be quite difficult to achieve. Therefore, since the device code is already executed in the non-nvrtc tests, it is reasonable to allow a test to skip running device code when NVRTC is enabled. This still tests whether the code actually compiles.
- Loading branch information
1 parent
a6054a0
commit 6be81eb
Showing
4 changed files
with
45 additions
and
6 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
libcudacxx/.upstream-tests/test/std/skip_nvrtc_launch.pass.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// -*- C++ -*- | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of libcu++, the C++ Standard Library for your entire system, | ||
// under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// UNSUPPORTED: libcpp-has-no-threads | ||
// UNSUPPORTED: !nvrtc | ||
// NVRTC_SKIP_KERNEL_RUN // do compile, but do not run under nvrtc | ||
|
||
#include <cuda/std/cassert> | ||
#include <nv/target> | ||
|
||
// This is a test of the NVRTC_SKIP_KERNEL_RUN tag that indicates that a test | ||
// should compiler under NVRTC, but should not be run. | ||
int main(int, char**) | ||
{ | ||
NV_DISPATCH_TARGET( | ||
NV_IS_DEVICE, ( | ||
// Ensure that code fails at runtime when run under NVRTC. | ||
assert(false); | ||
) | ||
); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
libcudacxx/.upstream-tests/utils/nvidia/nvrtc/post_tail.cu.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters