forked from NVIDIA/cccl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add popcount, clz, ctz builtin instrinsics * macro order and year update * fix macro names * skip c++11/14
- Loading branch information
Showing
8 changed files
with
183 additions
and
1 deletion.
There are no files selected for viewing
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
22 changes: 22 additions & 0 deletions
22
libcudacxx/test/libcudacxx/std/cccl/builtin.bit.clz.fail.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,22 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, 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) 2025 NVIDIA CORPORATION & AFFILIATES. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// UNSUPPORTED: c++03, c++11, c++14 | ||
|
||
#include <cuda/std/__cccl/builtin.h> | ||
|
||
int main(int, char**) | ||
{ | ||
#if !defined(_CCCL_BUILTIN_CLZ) | ||
auto x = _CCCL_BUILTIN_CLZ(0b10101010); | ||
unused(x); | ||
#else | ||
static_assert(false); | ||
#endif | ||
return 0; | ||
} |
22 changes: 22 additions & 0 deletions
22
libcudacxx/test/libcudacxx/std/cccl/builtin.bit.clzll.fail.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,22 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, 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) 2025 NVIDIA CORPORATION & AFFILIATES. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// UNSUPPORTED: c++03, c++11, c++14 | ||
|
||
#include <cuda/std/__cccl/builtin.h> | ||
|
||
int main(int, char**) | ||
{ | ||
#if !defined(_CCCL_BUILTIN_CLZLL) | ||
auto x = _CCCL_BUILTIN_CLZLL(0b10101010); | ||
unused(x); | ||
#else | ||
static_assert(false); | ||
#endif | ||
return 0; | ||
} |
22 changes: 22 additions & 0 deletions
22
libcudacxx/test/libcudacxx/std/cccl/builtin.bit.ctz.fail.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,22 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, 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) 2025 NVIDIA CORPORATION & AFFILIATES. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// UNSUPPORTED: c++03, c++11, c++14 | ||
|
||
#include <cuda/std/__cccl/builtin.h> | ||
|
||
int main(int, char**) | ||
{ | ||
#if !defined(_CCCL_BUILTIN_CTZ) | ||
auto x = _CCCL_BUILTIN_CTZ(0b10101010); | ||
unused(x); | ||
#else | ||
static_assert(false); | ||
#endif | ||
return 0; | ||
} |
22 changes: 22 additions & 0 deletions
22
libcudacxx/test/libcudacxx/std/cccl/builtin.bit.ctzll.fail.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,22 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, 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) 2025 NVIDIA CORPORATION & AFFILIATES. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// UNSUPPORTED: c++03, c++11, c++14 | ||
|
||
#include <cuda/std/__cccl/builtin.h> | ||
|
||
int main(int, char**) | ||
{ | ||
#if !defined(_CCCL_BUILTIN_CTZLL) | ||
auto x = _CCCL_BUILTIN_CTZLL(0b10101010); | ||
unused(x); | ||
#else | ||
static_assert(false); | ||
#endif | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, 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) 2025 NVIDIA CORPORATION & AFFILIATES. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// UNSUPPORTED: c++03, c++11, c++14 | ||
|
||
#include <cuda/std/__cccl/builtin.h> | ||
|
||
int main(int, char**) | ||
{ | ||
#if defined(_CCCL_BUILTIN_POPCOUNT) | ||
static_assert(_CCCL_BUILTIN_POPCOUNT(0b10101010) == 4); | ||
#endif | ||
#if defined(_CCCL_BUILTIN_POPCOUNTLL) | ||
static_assert(_CCCL_BUILTIN_POPCOUNTLL(0b10101010) == 4); | ||
#endif | ||
#if defined(_CCCL_BUILTIN_CLZ) | ||
static_assert(_CCCL_BUILTIN_CLZ(0b10101010) == 24); | ||
#endif | ||
#if defined(_CCCL_BUILTIN_CLZLL) | ||
static_assert(_CCCL_BUILTIN_CLZLL(0b10101010) == 56); | ||
#endif | ||
#if defined(_CCCL_BUILTIN_CTZ) | ||
static_assert(_CCCL_BUILTIN_CTZ(0b10101010) == 1); | ||
#endif | ||
#if defined(_CCCL_BUILTIN_CTZLL) | ||
static_assert(_CCCL_BUILTIN_CTZLL(0b10101010) == 1); | ||
#endif | ||
return 0; | ||
} |
22 changes: 22 additions & 0 deletions
22
libcudacxx/test/libcudacxx/std/cccl/builtin.bit.popc.fail.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,22 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, 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) 2025 NVIDIA CORPORATION & AFFILIATES. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// UNSUPPORTED: c++03, c++11, c++14 | ||
|
||
#include <cuda/std/__cccl/builtin.h> | ||
|
||
int main(int, char**) | ||
{ | ||
#if !defined(_CCCL_BUILTIN_POPCOUNT) | ||
auto x = _CCCL_BUILTIN_POPCOUNT(0b10101010); | ||
unused(x); | ||
#else | ||
static_assert(false); | ||
#endif | ||
return 0; | ||
} |
22 changes: 22 additions & 0 deletions
22
libcudacxx/test/libcudacxx/std/cccl/builtin.bit.popcll.fail.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,22 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, 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) 2025 NVIDIA CORPORATION & AFFILIATES. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// UNSUPPORTED: c++03, c++11, c++14 | ||
|
||
#include <cuda/std/__cccl/builtin.h> | ||
|
||
int main(int, char**) | ||
{ | ||
#if !defined(_CCCL_BUILTIN_POPCOUNTLL) | ||
auto x = _CCCL_BUILTIN_POPCOUNTLL(0b10101010); | ||
unused(x); | ||
#else | ||
static_assert(false); | ||
#endif | ||
return 0; | ||
} |