├── include ├── hip └── cuda │ ├── std │ ├── ccomplex │ └── variant │ ├── version │ └── atomic ├── docs ├── VERSION.md ├── .gitignore ├── repo.sh ├── libcudacxx │ ├── ptx │ │ ├── examples.rst │ │ ├── instructions │ │ │ ├── mbarrier.init.rst │ │ │ ├── cp.async.bulk.commit_group.rst │ │ │ ├── getctarank.rst │ │ │ └── cp.async.bulk.wait_group.rst │ │ └── instructions.rst │ ├── setup.rst │ ├── standard_api │ │ ├── numerics_library │ │ │ ├── bit.rst │ │ │ └── numeric.rst │ │ ├── container_library │ │ │ ├── array.rst │ │ │ ├── mdspan.rst │ │ │ ├── inplace_vector.rst │ │ │ └── span.rst │ │ └── utility_library │ │ │ ├── bitset.rst │ │ │ ├── type_traits.rst │ │ │ ├── expected.rst │ │ │ ├── optional.rst │ │ │ ├── utility.rst │ │ │ ├── tuple.rst │ │ │ ├── variant.rst │ │ │ └── version.rst │ ├── contributing.rst │ ├── extended_api │ │ ├── streams.rst │ │ ├── functional.rst │ │ ├── synchronization_primitives │ │ │ └── pipeline │ │ │ │ ├── destructor.rst │ │ │ │ ├── consumer_release.rst │ │ │ │ ├── producer_acquire.rst │ │ │ │ └── producer_commit.rst │ │ └── shapes.rst │ ├── extended_api.rst │ └── setup │ │ └── getting.rst ├── repo.bat ├── index.rst ├── scrape_docs.bash └── python.rst ├── codegen └── .gitignore ├── test ├── utils ├── .upstream-tests ├── utils │ ├── libcudacxx │ │ ├── empty.cpp │ │ ├── test │ │ │ └── __init__.py │ │ ├── __init__.py │ │ └── sym_check │ │ │ └── __init__.py │ ├── nvidia │ │ ├── getsm │ │ │ ├── .gitignore │ │ │ └── CMakeLists.txt │ │ └── nvrtc │ │ │ ├── utils │ │ │ ├── platform.h │ │ │ ├── platform.linux.h │ │ │ └── platform.win.h │ │ │ └── CMakeLists.txt │ └── amd │ │ └── hiprtc │ │ └── utils │ │ ├── platform.h │ │ ├── platform.linux.h │ │ └── platform.win.h ├── test │ ├── support │ │ ├── filesystem_include.h │ │ ├── nothing_to_do.pass.cpp │ │ ├── nvrtc_limit_macros.h │ │ ├── truncate_fp.h │ │ └── disable_missing_braces_warning.h │ ├── std │ │ ├── utilities │ │ │ ├── memory │ │ │ │ ├── allocator.traits │ │ │ │ │ └── allocator.traits.members │ │ │ │ │ │ └── incomplete_type_helper.h │ │ │ │ ├── smartptr │ │ │ │ │ └── unique.ptr │ │ │ │ │ │ ├── unique.ptr.dltr │ │ │ │ │ │ └── unique.ptr.dltr.general │ │ │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ │ │ └── README.TXT │ │ │ │ ├── sanity.pass.cpp │ │ │ │ ├── specialized.algorithms │ │ │ │ │ └── specialized.addressof │ │ │ │ │ │ └── addressof.temp.compile.fail.cpp │ │ │ │ └── allocator.tag │ │ │ │ │ └── allocator_arg.pass.cpp │ │ │ ├── nothing_to_do.pass.cpp │ │ │ ├── meta │ │ │ │ ├── meta.rqmts │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ ├── meta.trans │ │ │ │ │ ├── nothing_to_do.pass.cpp │ │ │ │ │ └── meta.trans.other │ │ │ │ │ │ ├── enable_if.fail.cpp │ │ │ │ │ │ ├── enable_if2.fail.cpp │ │ │ │ │ │ ├── aligned_union.fail.cpp │ │ │ │ │ │ ├── enable_if.pass.cpp │ │ │ │ │ │ └── conditional.pass.cpp │ │ │ │ ├── meta.unary │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ └── meta.type.synop │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ ├── ratio │ │ │ │ ├── ratio.si │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ ├── ratio.ratio │ │ │ │ │ ├── ratio1.fail.cpp │ │ │ │ │ ├── ratio2.fail.cpp │ │ │ │ │ └── ratio3.fail.cpp │ │ │ │ └── ratio.arithmetic │ │ │ │ │ ├── ratio_add.fail.cpp │ │ │ │ │ ├── ratio_divide.fail.cpp │ │ │ │ │ ├── ratio_multiply.fail.cpp │ │ │ │ │ └── ratio_subtract.fail.cpp │ │ │ ├── time │ │ │ │ ├── time.cal │ │ │ │ │ ├── nothing_to_do.pass.cpp │ │ │ │ │ ├── time.cal.day │ │ │ │ │ │ └── types.pass.cpp │ │ │ │ │ ├── time.cal.year │ │ │ │ │ │ └── types.pass.cpp │ │ │ │ │ ├── time.cal.month │ │ │ │ │ │ └── types.pass.cpp │ │ │ │ │ ├── time.cal.weekday │ │ │ │ │ │ └── types.pass.cpp │ │ │ │ │ ├── time.cal.md │ │ │ │ │ │ └── types.pass.cpp │ │ │ │ │ ├── time.cal.wdlast │ │ │ │ │ │ └── types.pass.cpp │ │ │ │ │ ├── time.cal.mwd │ │ │ │ │ │ └── types.pass.cpp │ │ │ │ │ ├── time.cal.wdidx │ │ │ │ │ │ └── types.pass.cpp │ │ │ │ │ ├── time.cal.mdlast │ │ │ │ │ │ └── types.pass.cpp │ │ │ │ │ ├── time.cal.ym │ │ │ │ │ │ └── types.pass.cpp │ │ │ │ │ ├── time.cal.mwdlast │ │ │ │ │ │ └── types.pass.cpp │ │ │ │ │ ├── time.cal.ymd │ │ │ │ │ │ └── types.pass.cpp │ │ │ │ │ ├── time.cal.ymwd │ │ │ │ │ │ └── types.pass.cpp │ │ │ │ │ └── time.cal.ymwdlast │ │ │ │ │ │ └── types.pass.cpp │ │ │ │ ├── time.clock │ │ │ │ │ ├── nothing_to_do.pass.cpp │ │ │ │ │ ├── time.clock.system │ │ │ │ │ │ ├── rep_signed.pass.cpp │ │ │ │ │ │ ├── to_time_t.pass.cpp │ │ │ │ │ │ ├── from_time_t.pass.cpp │ │ │ │ │ │ └── now.pass.cpp │ │ │ │ │ └── time.clock.hires │ │ │ │ │ │ └── now.pass.cpp │ │ │ │ ├── time.traits │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ ├── time.clock.req │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ ├── time.point │ │ │ │ │ ├── time.point.observer │ │ │ │ │ │ └── tested_elsewhere.pass.cpp │ │ │ │ │ ├── duration.fail.cpp │ │ │ │ │ └── time.point.cons │ │ │ │ │ │ └── duration.fail.cpp │ │ │ │ ├── time.duration │ │ │ │ │ ├── time.duration.observer │ │ │ │ │ │ └── tested_elsewhere.pass.cpp │ │ │ │ │ ├── time.duration.literals │ │ │ │ │ │ ├── literals1.fail.cpp │ │ │ │ │ │ └── literals2.fail.cpp │ │ │ │ │ ├── positive_num.fail.cpp │ │ │ │ │ ├── time.duration.cons │ │ │ │ │ │ ├── rep01.fail.cpp │ │ │ │ │ │ ├── rep03.fail.cpp │ │ │ │ │ │ ├── rep02.fail.cpp │ │ │ │ │ │ ├── convert_inexact.fail.cpp │ │ │ │ │ │ ├── rep02.pass.cpp │ │ │ │ │ │ └── convert_float_to_int.fail.cpp │ │ │ │ │ ├── duration.fail.cpp │ │ │ │ │ ├── default_ratio.pass.cpp │ │ │ │ │ ├── types.pass.cpp │ │ │ │ │ ├── ratio.fail.cpp │ │ │ │ │ ├── time.duration.cast │ │ │ │ │ │ ├── toduration.fail.cpp │ │ │ │ │ │ ├── ceil.fail.cpp │ │ │ │ │ │ ├── floor.fail.cpp │ │ │ │ │ │ └── round.fail.cpp │ │ │ │ │ └── time.duration.nonmember │ │ │ │ │ │ └── op_mod_rep.fail.cpp │ │ │ │ ├── time.hms │ │ │ │ │ └── time.hms.nonmembers │ │ │ │ │ │ └── nothing.to.do.pass.cpp │ │ │ │ └── clock.h │ │ │ ├── utility │ │ │ │ ├── pairs │ │ │ │ │ ├── nothing_to_do.pass.cpp │ │ │ │ │ ├── pairs.general │ │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ │ ├── pair.astuple │ │ │ │ │ │ ├── pairs.by.type2.fail.cpp │ │ │ │ │ │ ├── pairs.by.type1.fail.cpp │ │ │ │ │ │ ├── pairs.by.type3.fail.cpp │ │ │ │ │ │ └── tuple_element.fail.cpp │ │ │ │ │ ├── pair.piecewise │ │ │ │ │ │ └── piecewise_construct_t.pass.cpp │ │ │ │ │ └── pairs.pair │ │ │ │ │ │ └── types.pass.cpp │ │ │ │ ├── utility.unreachable │ │ │ │ │ ├── unreachable.verify.cpp │ │ │ │ │ └── unreachable.compile.pass.cpp │ │ │ │ └── as_const │ │ │ │ │ └── as_const.compile.fail.cpp │ │ │ ├── utility.requirements │ │ │ │ ├── nothing_to_do.pass.cpp │ │ │ │ ├── hash.requirements │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ ├── allocator.requirements │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ ├── swappable.requirements │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ ├── utility.arg.requirements │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ └── nullablepointer.requirements │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ ├── function.objects │ │ │ │ ├── func.def │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ ├── func.require │ │ │ │ │ └── INVOKE_tested_elsewhere.pass.cpp │ │ │ │ ├── negators │ │ │ │ │ ├── not1.pass.cpp │ │ │ │ │ └── not2.pass.cpp │ │ │ │ └── refwrap │ │ │ │ │ └── refwrap.const │ │ │ │ │ └── type_ctor.compile.fail.cpp │ │ │ ├── variant │ │ │ │ ├── variant.general │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ └── variant.synopsis │ │ │ │ │ └── variant_npos.pass.cpp │ │ │ ├── intseq │ │ │ │ └── intseq.make │ │ │ │ │ ├── make_integer_seq_fallback.pass.cpp │ │ │ │ │ └── make_integer_seq_fallback.compile.fail.cpp │ │ │ ├── tuple │ │ │ │ └── tuple.tuple │ │ │ │ │ ├── tuple.cnstr │ │ │ │ │ ├── copy.fail.cpp │ │ │ │ │ └── const_Types2.fail.cpp │ │ │ │ │ └── tuple.assign │ │ │ │ │ └── copy.fail.cpp │ │ │ └── optional │ │ │ │ └── optional.syn │ │ │ │ └── optional_includes_initializer_list.pass.cpp │ │ ├── numerics │ │ │ ├── bit │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ ├── complex.number │ │ │ │ ├── complex.synopsis │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ └── ccmplx │ │ │ │ │ └── ccomplex.pass.cpp │ │ │ └── numeric.ops │ │ │ │ ├── numeric.ops.gcd │ │ │ │ ├── gcd.bool1.compile.fail.cpp │ │ │ │ ├── gcd.bool2.compile.fail.cpp │ │ │ │ ├── gcd.not_integral1.compile.fail.cpp │ │ │ │ ├── gcd.not_integral2.compile.fail.cpp │ │ │ │ ├── gcd.bool4.compile.fail.cpp │ │ │ │ └── gcd.bool3.compile.fail.cpp │ │ │ │ └── numeric.ops.lcm │ │ │ │ ├── lcm.bool1.compile.fail.cpp │ │ │ │ ├── lcm.bool2.compile.fail.cpp │ │ │ │ ├── lcm.not_integral1.compile.fail.cpp │ │ │ │ ├── lcm.not_integral2.compile.fail.cpp │ │ │ │ ├── lcm.bool4.compile.fail.cpp │ │ │ │ └── lcm.bool3.compile.fail.cpp │ │ ├── language.support │ │ │ ├── nothing_to_do.pass.cpp │ │ │ ├── support.limits │ │ │ │ ├── nothing_to_do.pass.cpp │ │ │ │ ├── limits │ │ │ │ │ └── numeric.special │ │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ └── version.pass.cpp │ │ │ ├── support.general │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ ├── support.types │ │ │ │ ├── null.pass.cpp │ │ │ │ ├── nullptr_t_integral_cast.fail.cpp │ │ │ │ ├── offsetof.pass.cpp │ │ │ │ ├── nullptr_t_integral_cast.pass.cpp │ │ │ │ └── byteops │ │ │ │ │ ├── enum_direct_init.pass.cpp │ │ │ │ │ ├── to_integer.fail.cpp │ │ │ │ │ ├── lshift.fail.cpp │ │ │ │ │ └── rshift.fail.cpp │ │ │ ├── support.dynamic │ │ │ │ └── ptr.launder │ │ │ │ │ └── launder.nodiscard.verify.cpp │ │ │ └── support.exception │ │ │ │ └── exception.terminate │ │ │ │ └── set.terminate │ │ │ │ └── set_terminate.pass.cpp │ │ ├── nothing_to_do.pass.cpp │ │ ├── atomics │ │ │ ├── atomics.syn │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ ├── atomics.general │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ ├── atomics.types.operations │ │ │ │ ├── nothing_to_do.pass.cpp │ │ │ │ ├── atomics.types.operations.arith │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ ├── atomics.types.operations.general │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ ├── atomics.types.operations.pointer │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ ├── atomics.types.operations.templ │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ └── atomics.types.operations.req │ │ │ │ │ └── atomic_var_init.pass.cpp │ │ │ ├── atomics.fences │ │ │ │ ├── atomic_signal_fence.pass.cpp │ │ │ │ └── atomic_thread_fence.pass.cpp │ │ │ ├── atomics.order │ │ │ │ └── kill_dependency.pass.cpp │ │ │ └── atomics.flag │ │ │ │ ├── copy_ctor.fail.cpp │ │ │ │ ├── copy_assign.fail.cpp │ │ │ │ └── copy_volatile_assign.fail.cpp │ │ ├── iterators │ │ │ ├── iterator.synopsis │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ ├── iterators.general │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ ├── predef.iterators │ │ │ │ ├── nothing_to_do.pass.cpp │ │ │ │ ├── insert.iterators │ │ │ │ │ ├── nothing_to_do.pass.cpp │ │ │ │ │ ├── insert.iter.ops │ │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ │ ├── back.insert.iter.ops │ │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ │ └── front.insert.iter.ops │ │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ └── move.iterators │ │ │ │ │ ├── move.iter.requirements │ │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ │ └── move.iter.ops │ │ │ │ │ └── move.iter.op.ref │ │ │ │ │ └── deprecated.verify.cpp │ │ │ ├── stream.iterators │ │ │ │ ├── nothing_to_do.pass.cpp │ │ │ │ ├── iterator.range │ │ │ │ │ ├── begin_array.pass.cpp │ │ │ │ │ └── end_array.pass.cpp │ │ │ │ └── istream.iterator │ │ │ │ │ └── istream.iterator.cons │ │ │ │ │ └── default.fail.cpp │ │ │ ├── iterator.primitives │ │ │ │ ├── nothing_to_do.pass.cpp │ │ │ │ ├── iterator.basic │ │ │ │ │ └── deprecated.verify.cpp │ │ │ │ └── std.iterator.tags │ │ │ │ │ ├── input_iterator_tag.pass.cpp │ │ │ │ │ └── output_iterator_tag.pass.cpp │ │ │ └── iterator.requirements │ │ │ │ ├── input.iterators │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ ├── forward.iterators │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ ├── iterator.iterators │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ ├── output.iterators │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ ├── bidirectional.iterators │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ ├── random.access.iterators │ │ │ │ └── nothing_to_do.pass.cpp │ │ │ │ └── iterator.requirements.general │ │ │ │ └── nothing_to_do.pass.cpp │ │ └── containers │ │ │ ├── sequences │ │ │ └── array │ │ │ │ └── array.zero │ │ │ │ └── tested_elsewhere.pass.cpp │ │ │ └── views │ │ │ ├── mdspan │ │ │ ├── mdspan.mdspan.util │ │ │ │ └── mdspan_util.hpp │ │ │ └── mdspan.accessor.default.members │ │ │ │ └── access.pass.cpp │ │ │ └── views.span │ │ │ └── trivially_copyable.compile.pass.cpp │ ├── heterogeneous │ │ └── nothing_to_do.pass.cpp │ ├── cuda │ │ ├── atomics │ │ │ └── atomic.ext │ │ │ │ └── nothing_to_do.pass.cpp │ │ ├── version.pass.cpp │ │ ├── chrono │ │ │ ├── to_time_t.pass.cpp │ │ │ └── from_time_t.pass.cpp │ │ └── proclaim_return_type.fail.cpp │ ├── libcxx │ │ ├── utilities │ │ │ └── meta │ │ │ │ └── version.pass.cpp │ │ └── atomics │ │ │ ├── libcpp-has-no-threads.pass.cpp │ │ │ └── version.pass.cpp │ └── internal_headers │ │ └── header_test.cpp.in └── maintenance │ ├── cuda-to-std │ └── std-to-cuda ├── ._upstream ├── .devcontainer │ ├── cuda12.5-rapids-conda │ ├── img │ │ ├── run.png │ │ ├── debug.png │ │ ├── nsight.png │ │ ├── github_auth.png │ │ ├── build_button.png │ │ ├── container_list.png │ │ ├── cmaketools_presets.png │ │ ├── cmaketools_sidebar.png │ │ ├── cmaketools_targets.png │ │ ├── reopen_in_container.png │ │ └── open_in_container_manual.png │ └── cccl-entrypoint.sh ├── .github │ ├── copy-pr-bot.yaml │ ├── problem-matchers │ │ └── problem-matcher.json │ ├── workflows │ │ ├── workflow-dispatch-two-stage-group-linux.yml │ │ └── workflow-dispatch-two-stage-group-windows.yml │ └── actions │ │ └── workflow-results │ │ └── verify-job-success.py └── .upstream-tests │ └── atomic_codegen │ ├── dump_and_check.bash │ ├── atomic_store_non_volatile.cu │ ├── atomic_load_non_volatile.cu │ ├── atomic_add_non_volatile.cu │ ├── atomic_exch_non_volatile.cu │ └── atomic_sub_non_volatile.cu ├── ci ├── build_libhipcxx.sh ├── hiprtc_libhipcxx.sh └── test_libhipcxx.sh ├── cmake ├── test │ └── test_export │ │ └── version_check.cxx └── DetermineGCCCompatible.cmake ├── .vscode └── launch.json ├── .github └── PULL_REQUEST_TEMPLATE.md └── .git-blame-ignore-revs /include/hip: -------------------------------------------------------------------------------- 1 | cuda -------------------------------------------------------------------------------- /docs/VERSION.md: -------------------------------------------------------------------------------- 1 | 2.5 2 | -------------------------------------------------------------------------------- /codegen/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /test: -------------------------------------------------------------------------------- 1 | .upstream-tests/test -------------------------------------------------------------------------------- /utils: -------------------------------------------------------------------------------- 1 | .upstream-tests/utils -------------------------------------------------------------------------------- /.upstream-tests/utils/libcudacxx/empty.cpp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.upstream-tests/utils/libcudacxx/test/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.upstream-tests/utils/nvidia/getsm/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | _build 2 | _repo 3 | api 4 | *png 5 | cubimg 6 | -------------------------------------------------------------------------------- /._upstream/.devcontainer/cuda12.5-rapids-conda: -------------------------------------------------------------------------------- 1 | ../ci/rapids/cuda12.5-conda -------------------------------------------------------------------------------- /._upstream/.devcontainer/img/run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/libhipcxx/HEAD/._upstream/.devcontainer/img/run.png -------------------------------------------------------------------------------- /._upstream/.devcontainer/img/debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/libhipcxx/HEAD/._upstream/.devcontainer/img/debug.png -------------------------------------------------------------------------------- /._upstream/.devcontainer/img/nsight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/libhipcxx/HEAD/._upstream/.devcontainer/img/nsight.png -------------------------------------------------------------------------------- /._upstream/.devcontainer/img/github_auth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/libhipcxx/HEAD/._upstream/.devcontainer/img/github_auth.png -------------------------------------------------------------------------------- /._upstream/.devcontainer/img/build_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/libhipcxx/HEAD/._upstream/.devcontainer/img/build_button.png -------------------------------------------------------------------------------- /._upstream/.devcontainer/img/container_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/libhipcxx/HEAD/._upstream/.devcontainer/img/container_list.png -------------------------------------------------------------------------------- /._upstream/.devcontainer/img/cmaketools_presets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/libhipcxx/HEAD/._upstream/.devcontainer/img/cmaketools_presets.png -------------------------------------------------------------------------------- /._upstream/.devcontainer/img/cmaketools_sidebar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/libhipcxx/HEAD/._upstream/.devcontainer/img/cmaketools_sidebar.png -------------------------------------------------------------------------------- /._upstream/.devcontainer/img/cmaketools_targets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/libhipcxx/HEAD/._upstream/.devcontainer/img/cmaketools_targets.png -------------------------------------------------------------------------------- /._upstream/.devcontainer/img/reopen_in_container.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/libhipcxx/HEAD/._upstream/.devcontainer/img/reopen_in_container.png -------------------------------------------------------------------------------- /._upstream/.devcontainer/img/open_in_container_manual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/libhipcxx/HEAD/._upstream/.devcontainer/img/open_in_container_manual.png -------------------------------------------------------------------------------- /docs/repo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | SCRIPT_DIR=$(dirname ${BASH_SOURCE}) 6 | cd "$SCRIPT_DIR" 7 | 8 | exec "tools/packman/python.sh" tools/repoman/repoman.py $@ 9 | -------------------------------------------------------------------------------- /docs/libcudacxx/ptx/examples.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-ptx-examples: 2 | 3 | Examples 4 | ======== 5 | 6 | .. toctree:: 7 | :hidden: 8 | :maxdepth: 1 9 | 10 | examples/st.async 11 | -------------------------------------------------------------------------------- /.upstream-tests/utils/amd/hiprtc/utils/platform.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(_MSC_VER) 4 | # define WINDOWS_STUFF 5 | # include "platform.win.h" 6 | #else 7 | # include "platform.linux.h" 8 | #endif 9 | -------------------------------------------------------------------------------- /.upstream-tests/utils/nvidia/nvrtc/utils/platform.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(_MSC_VER) 4 | # define WINDOWS_STUFF 5 | # include "platform.win.h" 6 | #else 7 | # include "platform.linux.h" 8 | #endif 9 | -------------------------------------------------------------------------------- /docs/libcudacxx/setup.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-setup: 2 | 3 | Setup 4 | ===== 5 | 6 | .. toctree:: 7 | :maxdepth: 1 8 | 9 | setup/requirements 10 | setup/getting 11 | setup/building_and_testing 12 | -------------------------------------------------------------------------------- /.upstream-tests/utils/amd/hiprtc/utils/platform.linux.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | static void platform_exec(char const* process, char** args, size_t) 6 | { 7 | execvp(process, args); 8 | } 9 | -------------------------------------------------------------------------------- /.upstream-tests/utils/nvidia/nvrtc/utils/platform.linux.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | static void platform_exec(char const* process, char** args, size_t) 6 | { 7 | execvp(process, args); 8 | } 9 | -------------------------------------------------------------------------------- /._upstream/.github/copy-pr-bot.yaml: -------------------------------------------------------------------------------- 1 | # Configuration file for `copy-pr-bot` GitHub App 2 | # https://docs.gha-runners.nvidia.com/apps/copy-pr-bot/ 3 | 4 | enabled: true 5 | additional_trustees: 6 | - ahendriksen 7 | - gonzalobg 8 | -------------------------------------------------------------------------------- /docs/repo.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | call "%~dp0tools\packman\python.bat" %~dp0tools\repoman\repoman.py %* 4 | if %errorlevel% neq 0 ( goto Error ) 5 | 6 | :Success 7 | exit /b 0 8 | 9 | :Error 10 | exit /b %errorlevel% 11 | -------------------------------------------------------------------------------- /.upstream-tests/utils/nvidia/getsm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.8) 2 | 3 | project(getsm CUDA) 4 | 5 | add_executable(getsm 6 | main.cu) 7 | 8 | add_custom_target( 9 | get-sm ALL 10 | COMMAND getsm 11 | ) 12 | -------------------------------------------------------------------------------- /docs/libcudacxx/standard_api/numerics_library/bit.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-standard-api-numerics-bit: 2 | 3 | ```` 4 | ====================== 5 | 6 | Extensions 7 | ---------- 8 | 9 | - All features of ```` are made available in C++11 onwards 10 | -------------------------------------------------------------------------------- /._upstream/.upstream-tests/atomic_codegen/dump_and_check.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | ## Usage: dump_and_check test.a test.cu PREFIX 5 | input_archive=$1 6 | input_testfile=$2 7 | input_prefix=$3 8 | 9 | cuobjdump --dump-ptx $input_archive | FileCheck --check-prefix $input_prefix $input_testfile 10 | -------------------------------------------------------------------------------- /ci/build_libhipcxx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euo pipefail 4 | 5 | source "$(dirname "$0")/build_common.sh" 6 | 7 | print_environment_details 8 | 9 | PRESET="libcudacxx-cpp${CXX_STANDARD}" 10 | CMAKE_OPTIONS="" 11 | 12 | configure_and_build_preset libcudacxx "$PRESET" "$CMAKE_OPTIONS" 13 | 14 | print_time_summary 15 | -------------------------------------------------------------------------------- /docs/libcudacxx/standard_api/container_library/array.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-standard-api-container-array: 2 | 3 | ```` 4 | ====================== 5 | 6 | Extensions 7 | ---------- 8 | 9 | - All features of ```` are made available in C++14 onwards 10 | - All features of ```` are made constexpr in C++14 onwards 11 | -------------------------------------------------------------------------------- /._upstream/.github/problem-matchers/problem-matcher.json: -------------------------------------------------------------------------------- 1 | { 2 | "problemMatcher": [ 3 | { 4 | "owner": "nvcc", 5 | "pattern": [ 6 | { 7 | "regexp": "^\\/home\\/coder\\/(.+):(\\d+):(\\d+): (\\w+): \"(.+)\"$", 8 | "severity": 4, 9 | "message": 5 10 | } 11 | ] 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /docs/libcudacxx/contributing.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-contributing: 2 | 3 | Contributing 4 | ============ 5 | 6 | .. toctree:: 7 | :maxdepth: 1 8 | 9 | contributing/code_of_conduct 10 | 11 | We welcome contributions - just send us a pull request! 12 | 13 | libcu++ uses the `Apache License v2.0 with LLVM Exceptions `_. 14 | -------------------------------------------------------------------------------- /._upstream/.devcontainer/cccl-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck disable=SC1091 4 | 5 | set -e; 6 | 7 | devcontainer-utils-post-create-command; 8 | devcontainer-utils-init-git; 9 | devcontainer-utils-post-attach-command; 10 | 11 | cd /home/coder/cccl/ 12 | 13 | if test $# -gt 0; then 14 | exec "$@"; 15 | else 16 | exec /bin/bash -li; 17 | fi 18 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | CUDA Core Compute Libraries 2 | =========================== 3 | 4 | .. toctree:: 5 | :hidden: 6 | :maxdepth: 3 7 | 8 | cpp 9 | python 10 | 11 | Welcome to the CUDA Core Compute Libraries (CCCL) where our mission is to 12 | make CUDA C++ and Python more delightful. 13 | 14 | - :ref:`cccl-cpp-libraries` 15 | 16 | - :ref:`cccl-python-libraries` 17 | -------------------------------------------------------------------------------- /.upstream-tests/test/support/filesystem_include.h: -------------------------------------------------------------------------------- 1 | #ifndef TEST_SUPPORT_FILESYSTEM_INCLUDE_H 2 | #define TEST_SUPPORT_FILESYSTEM_INCLUDE_H 3 | 4 | #include 5 | 6 | #include "test_macros.h" 7 | 8 | #if defined(_LIBCUDACXX_VERSION) && TEST_STD_VER < 2017 9 | namespace fs = std::__fs::filesystem; 10 | #else 11 | namespace fs = std::filesystem; 12 | #endif 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /docs/libcudacxx/standard_api/utility_library/bitset.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-standard-api-utility-bitset: 2 | 3 | ```` 4 | ====================== 5 | 6 | Extensions 7 | ---------- 8 | 9 | - All features of ```` are made constexpr in C++14 onwards 10 | 11 | Restrictions 12 | ------------ 13 | 14 | - On device no exceptions are thrown in case of a bad access. 15 | -------------------------------------------------------------------------------- /docs/libcudacxx/standard_api/utility_library/type_traits.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-standard-api-utility-type-traits: 2 | 3 | 4 | ======================= 5 | 6 | See the documentation of the standard header `\ `_ 7 | 8 | Extensions 9 | ---------- 10 | 11 | - Most type traits are made available in C++11. 12 | -------------------------------------------------------------------------------- /cmake/test/test_export/version_check.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | int main() 6 | { 7 | cuda::std::atomic x{0}; 8 | 9 | printf("Built with libcudacxx version %d.%d.%d.\n", 10 | _LIBCUDACXX_CUDA_API_VERSION_MAJOR, 11 | _LIBCUDACXX_CUDA_API_VERSION_MINOR, 12 | _LIBCUDACXX_CUDA_API_VERSION_PATCH); 13 | 14 | return x; 15 | } 16 | -------------------------------------------------------------------------------- /ci/hiprtc_libhipcxx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source "$(dirname "$0")/build_common.sh" 4 | 5 | print_environment_details 6 | 7 | 8 | PRESET="libcudacxx-nvrtc-cpp${CXX_STANDARD}" 9 | CMAKE_OPTIONS="" 10 | 11 | configure_and_build_preset "libcudacxx NVRTC" "$PRESET" "$CMAKE_OPTIONS" 12 | 13 | source "./sccache_stats.sh" "start" 14 | test_preset "libcudacxx NVRTC" "${PRESET}" 15 | source "./sccache_stats.sh" "end" 16 | -------------------------------------------------------------------------------- /.upstream-tests/utils/nvidia/nvrtc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(nvrtcc) 2 | 3 | enable_language(CUDA) 4 | find_package(CUDAToolkit REQUIRED) 5 | 6 | add_executable(libcudacxx.nvrtcc nvrtcc.cpp) 7 | 8 | set_target_properties(libcudacxx.nvrtcc PROPERTIES OUTPUT_NAME nvrtcc) 9 | target_link_libraries(libcudacxx.nvrtcc CUDA::nvrtc CUDA::cudart CUDA::cuda_driver) 10 | target_compile_features(libcudacxx.nvrtcc PRIVATE cxx_std_17) 11 | -------------------------------------------------------------------------------- /docs/libcudacxx/standard_api/container_library/mdspan.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-standard-api-container-mdspan: 2 | 3 | ```` 4 | ====================== 5 | 6 | Extensions 7 | ---------- 8 | 9 | - All features of ```` are made available in C++17 onwards 10 | 11 | Restrictions 12 | ------------ 13 | 14 | - On device no exceptions are thrown in case of a bad access. 15 | - MSVC is only supported with C++20 16 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/memory/allocator.traits/allocator.traits.members/incomplete_type_helper.h: -------------------------------------------------------------------------------- 1 | #ifndef TEST_INCOMPLETE_TYPE_HELPER_H 2 | #define TEST_INCOMPLETE_TYPE_HELPER_H 3 | 4 | #include "min_allocator.h" 5 | 6 | namespace NS 7 | { 8 | struct Incomplete; 9 | } 10 | 11 | template 12 | struct Holder 13 | { 14 | T value; 15 | }; 16 | 17 | typedef Holder IncompleteHolder; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /docs/libcudacxx/standard_api/container_library/inplace_vector.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-standard-api-container-inplace-vector: 2 | 3 | ```` 4 | ============================== 5 | 6 | Extensions 7 | ---------- 8 | 9 | - Most features of ```` are made available in C++14 onwards 10 | 11 | Restrictions 12 | ------------ 13 | 14 | - The range based interface is only available with ranges support in C++17 15 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "(cuda-gdb) Launch", 6 | "type": "cuda-gdb", 7 | "request": "launch", 8 | "program": "${command:cmake.launchTargetPath}", 9 | "stopAtEntry": true, 10 | "cwd": "${workspaceFolder}", 11 | "initCommands": ["set cuda api_failures stop"] 12 | 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /docs/libcudacxx/extended_api/streams.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-extended-api-streams: 2 | 3 | Streams 4 | ======= 5 | 6 | .. toctree:: 7 | :hidden: 8 | :maxdepth: 1 9 | 10 | cuda::stream_ref 11 | 12 | .. list-table:: 13 | :widths: 25 45 30 14 | :header-rows: 0 15 | 16 | * - :ref:`stream_ref ` 17 | - A wrapper around a ``cudaStream_t`` 18 | - CCCL 2.2.0 / CUDA 12.3 19 | -------------------------------------------------------------------------------- /docs/libcudacxx/standard_api/utility_library/expected.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-standard-api-utility-expected: 2 | 3 | 4 | ======================= 5 | 6 | See the documentation of the standard header `\ `_ 7 | 8 | Extensions 9 | ---------- 10 | 11 | - All features are available from C++14 onwards. 12 | 13 | Restrictions 14 | ------------ 15 | 16 | - On device no exceptions are thrown in case of a bad access. 17 | -------------------------------------------------------------------------------- /.upstream-tests/maintenance/cuda-to-std: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | root_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd) 6 | 7 | stdlib_headers=$(<"${root_dir}/maintenance/stdlib-headers") 8 | header_replacements=$(echo "${stdlib_headers}" | sed 's#<\(.*\)>#-e s::<\1>:g#') 9 | 10 | find "${root_dir}/test" -name "*.cpp" | 11 | while read -r file 12 | do 13 | sed -i "${file}" ${header_replacements} 14 | sed -i "${file}" -e 's/cuda::std::/std::/g' 15 | done 16 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/numerics/bit/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // The LLVM Compiler Infrastructure 4 | // 5 | // This file is dual licensed under the MIT and the University of Illinois Open 6 | // Source Licenses. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /docs/libcudacxx/extended_api.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-extended-api: 2 | 3 | Extended API 4 | ============ 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | extended_api/memory_model 10 | extended_api/thread_groups 11 | extended_api/shapes 12 | extended_api/synchronization_primitives 13 | extended_api/asynchronous_operations 14 | extended_api/memory_access_properties 15 | extended_api/functional 16 | extended_api/streams 17 | extended_api/memory_resource 18 | extended_api/math 19 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | int main(int, char**) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/language.support/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | int main(int, char**) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /.upstream-tests/maintenance/std-to-cuda: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | root_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd) 6 | 7 | stdlib_headers=$(<"${root_dir}/maintenance/stdlib-headers") 8 | header_replacements=$(echo "${stdlib_headers}" | sed 's#<\(.*\)>#-e s:<\1>::g#') 9 | 10 | find "${root_dir}/test" -name "*.cpp" | 11 | while read -r file 12 | do 13 | sed -i "${file}" ${header_replacements} 14 | perl -pi -e 's/((?`` 4 | ====================== 5 | 6 | Extensions 7 | ---------- 8 | 9 | - All features of ```` are made available in C++14 onwards 10 | - All features of ```` are made constexpr in C++14 onwards 11 | 12 | Restrictions 13 | ------------ 14 | 15 | - On device no exceptions are thrown in case of a bad access. 16 | - The range based constructors are emulated but not 100% equivalent. 17 | -------------------------------------------------------------------------------- /.upstream-tests/test/heterogeneous/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | //===----------------------------------------------------------------------===// 3 | // 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5 | // See https://llvm.org/LICENSE.txt for license information. 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/language.support/support.limits/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | int main(int, char**) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/meta/meta.type.synop/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | int main(int, char**) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.clock.req/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | int main(int, char**) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/utility.requirements/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | int main(int, char**) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/language.support/support.general/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | int main(int, char**) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/function.objects/func.def/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | int main(int, char**) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/variant/variant.general/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | int main(int, char**) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /.upstream-tests/test/cuda/atomics/atomic.ext/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | //===----------------------------------------------------------------------===// 3 | // 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5 | // See https://llvm.org/LICENSE.txt for license information. 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/atomics/atomics.syn/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | //===----------------------------------------------------------------------===// 3 | // 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5 | // See https://llvm.org/LICENSE.txt for license information. 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/utility/pairs/pairs.general/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | int main(int, char**) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/atomics/atomics.general/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | //===----------------------------------------------------------------------===// 3 | // 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5 | // See https://llvm.org/LICENSE.txt for license information. 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /docs/libcudacxx/extended_api/functional.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-extended-api-functional: 2 | 3 | Function wrapper 4 | ----------------- 5 | 6 | .. toctree:: 7 | :hidden: 8 | :maxdepth: 1 9 | 10 | functional/proclaim_return_type 11 | 12 | .. list-table:: 13 | :widths: 25 45 30 14 | :header-rows: 0 15 | 16 | * - :ref:`cuda::proclaim_return_type ` 17 | - Creates a forwarding call wrapper that proclaims return type 18 | - libcu++ 1.9.0 / CCCL 2.0.0 / CUDA 11.8 19 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.point/time.point.observer/tested_elsewhere.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | int main(int, char**) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/utility.requirements/hash.requirements/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | int main(int, char**) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/atomics/atomics.types.operations/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | //===----------------------------------------------------------------------===// 3 | // 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5 | // See https://llvm.org/LICENSE.txt for license information. 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/language.support/support.limits/limits/numeric.special/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | int main(int, char**) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.duration/time.duration.observer/tested_elsewhere.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | int main(int, char**) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/utility.requirements/allocator.requirements/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | int main(int, char**) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/utility.requirements/swappable.requirements/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | int main(int, char**) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/utility.requirements/utility.arg.requirements/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | int main(int, char**) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /cmake/DetermineGCCCompatible.cmake: -------------------------------------------------------------------------------- 1 | # Determine if the compiler has GCC-compatible command-line syntax. 2 | 3 | if(NOT DEFINED LLVM_COMPILER_IS_GCC_COMPATIBLE) 4 | if(CMAKE_COMPILER_IS_GNUCXX) 5 | set(LLVM_COMPILER_IS_GCC_COMPATIBLE ON) 6 | elseif( MSVC ) 7 | set(LLVM_COMPILER_IS_GCC_COMPATIBLE OFF) 8 | elseif( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" ) 9 | set(LLVM_COMPILER_IS_GCC_COMPATIBLE ON) 10 | elseif( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel" ) 11 | set(LLVM_COMPILER_IS_GCC_COMPATIBLE ON) 12 | endif() 13 | endif() 14 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/utility.requirements/nullablepointer.requirements/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | int main(int, char**) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | 4 | closes 5 | 6 | 7 | 8 | 9 | 10 | ## Checklist 11 | 12 | - [ ] New or existing tests cover these changes. 13 | - [ ] The documentation is up to date with these changes. 14 | -------------------------------------------------------------------------------- /docs/libcudacxx/standard_api/utility_library/optional.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-standard-api-utility-optional: 2 | 3 | 4 | ======================= 5 | 6 | See the documentation of the standard header `\ `_ 7 | 8 | Extensions 9 | ---------- 10 | 11 | - All features are available from C++14 onwards. 12 | - All features are available at compile time if the value type supports it. 13 | 14 | Restrictions 15 | ------------ 16 | 17 | - On device no exceptions are thrown in case of a bad access. 18 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/atomics/atomics.types.operations/atomics.types.operations.arith/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | //===----------------------------------------------------------------------===// 3 | // 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5 | // See https://llvm.org/LICENSE.txt for license information. 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/atomics/atomics.types.operations/atomics.types.operations.general/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | //===----------------------------------------------------------------------===// 3 | // 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5 | // See https://llvm.org/LICENSE.txt for license information. 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/atomics/atomics.types.operations/atomics.types.operations.pointer/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | //===----------------------------------------------------------------------===// 3 | // 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5 | // See https://llvm.org/LICENSE.txt for license information. 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/atomics/atomics.types.operations/atomics.types.operations.templ/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | //===----------------------------------------------------------------------===// 3 | // 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5 | // See https://llvm.org/LICENSE.txt for license information. 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /docs/scrape_docs.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ## Usage: 4 | ## ./scrape_docs.bash [path] 5 | ## [path] is the starting point for searching for HTML. Ideally this is the siteroot 6 | ## script will find all HTML files and record them into a CSV file that can be used for searching docs. 7 | 8 | set -e 9 | 10 | SCRIPT_PATH=$(cd $(dirname ${0}); pwd -P) 11 | 12 | path_to_docs=$(realpath $1) 13 | 14 | cd $SCRIPT_PATH 15 | 16 | thrust=$( 17 | cd $path_to_docs; 18 | find ./ -iname "*.html" -printf 'cccl/%P,' 19 | ) 20 | 21 | echo "$thrust" > $path_to_docs/pagelist.txt 22 | -------------------------------------------------------------------------------- /docs/libcudacxx/standard_api/numerics_library/numeric.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-standard-api-numerics-numeric: 2 | 3 | ```` 4 | ====================== 5 | 6 | Omissions 7 | --------- 8 | 9 | - Currently we do not expose any parallel algorithms. 10 | - Saturation arithmetics have not been implemented yet 11 | 12 | Extensions 13 | ---------- 14 | 15 | - All features of ```` are made available in C++11 onwards 16 | - All features of ```` are made constexpr in C++14 onwards 17 | - Algorithms that return a value and not an iterator have been marked ``[[nodiscard]]`` 18 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/iterator.synopsis/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/iterators.general/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/predef.iterators/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/stream.iterators/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/iterator.primitives/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/numerics/complex.number/complex.synopsis/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /docs/libcudacxx/extended_api/synchronization_primitives/pipeline/destructor.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-extended-api-synchronization-pipeline-pipeline-destructor: 2 | 3 | cuda::pipeline::~pipeline 4 | ============================= 5 | 6 | Defined in header ````: 7 | 8 | .. code:: cuda 9 | 10 | template 11 | __host__ __device__ 12 | cuda::pipeline::~pipeline(); 13 | 14 | Destructs the pipeline. Calls :ref:`cuda::pipeline::quit ` 15 | if it was not called by the current thread and destructs the pipeline. 16 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/iterator.requirements/input.iterators/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/predef.iterators/insert.iterators/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /docs/libcudacxx/ptx/instructions/mbarrier.init.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-ptx-instructions-mbarrier-init: 2 | 3 | mbarrier.init 4 | ============= 5 | 6 | - PTX ISA: 7 | `mbarrier.arrive `__ 8 | 9 | mbarrier.init.shared.b64 10 | ^^^^^^^^^^^^^^^^^^^^^^^^ 11 | .. code:: cuda 12 | 13 | // mbarrier.init.shared.b64 [addr], count; // PTX ISA 70, SM_80 14 | template 15 | __device__ static inline void mbarrier_init( 16 | uint64_t* addr, 17 | const uint32_t& count); 18 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/iterator.requirements/forward.iterators/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/iterator.requirements/iterator.iterators/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/iterator.requirements/output.iterators/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/iterator.requirements/bidirectional.iterators/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/iterator.requirements/random.access.iterators/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /docs/libcudacxx/ptx/instructions/cp.async.bulk.commit_group.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-ptx-instructions-cp-async-bulk-commit_group: 2 | 3 | cp.async.bulk.commit_group 4 | ========================== 5 | 6 | - PTX ISA: 7 | `cp.async.bulk.commit_group `__ 8 | 9 | cp.async.bulk.commit_group 10 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 11 | .. code:: cuda 12 | 13 | // cp.async.bulk.commit_group; // PTX ISA 80, SM_90 14 | template 15 | __device__ static inline void cp_async_bulk_commit_group(); 16 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/iterator.requirements/iterator.requirements.general/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/predef.iterators/insert.iterators/insert.iter.ops/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /include/cuda/std/ccomplex: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the CUDA Toolkit, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | #ifndef _CUDA_STD_CCOMPLEX 11 | #define _CUDA_STD_CCOMPLEX 12 | 13 | #include 14 | 15 | #endif // _CUDA_STD_CCOMPLEX 16 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/predef.iterators/insert.iterators/back.insert.iter.ops/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/predef.iterators/insert.iterators/front.insert.iter.ops/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/predef.iterators/move.iterators/move.iter.requirements/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /docs/libcudacxx/ptx/instructions/getctarank.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-ptx-instructions-getctarank: 2 | 3 | getctarank 4 | ========== 5 | 6 | - PTX ISA: 7 | `getctarank `__ 8 | 9 | getctarank.shared::cluster.u32 10 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 11 | .. code:: cuda 12 | 13 | // getctarank{.space}.u32 dest, addr; // PTX ISA 78, SM_90 14 | // .space = { .shared::cluster } 15 | template 16 | __device__ static inline uint32_t getctarank( 17 | cuda::ptx::space_cluster_t, 18 | const void* addr); 19 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/language.support/support.types/null.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #include 10 | 11 | #include "test_macros.h" 12 | 13 | #ifndef NULL 14 | # error NULL not defined 15 | #endif 16 | 17 | int main(int, char**) 18 | { 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /.upstream-tests/utils/libcudacxx/__init__.py: -------------------------------------------------------------------------------- 1 | #===----------------------------------------------------------------------===## 2 | # 3 | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | # See https://llvm.org/LICENSE.txt for license information. 5 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | # 7 | #===----------------------------------------------------------------------===## 8 | 9 | """libcxx python utilities""" 10 | 11 | __author__ = 'Eric Fiselier' 12 | __email__ = 'eric@efcs.ca' 13 | __versioninfo__ = (0, 1, 0) 14 | __version__ = ' '.join(str(v) for v in __versioninfo__) + 'dev' 15 | 16 | __all__ = [] 17 | -------------------------------------------------------------------------------- /docs/libcudacxx/setup/getting.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-setup-getting: 2 | 3 | Getting libcu++ 4 | =============== 5 | 6 | NVIDIA HPC SDK or CUDA Toolkit 7 | ------------------------------ 8 | 9 | libcu++ is included in the NVIDIA HPC SDK and the CUDA Toolkit. It is on 10 | the default include path. Today, there is no shared library component to 11 | libcu++; it's all header-only. No additional compiler flags are needed. 12 | 13 | GitHub 14 | ------ 15 | 16 | libcu++ is an open source project developed on GitHub, which is where 17 | you'll find the latest versions and the development branch. Our GitHub 18 | repository is `github.com/nvidia/cccl `_. 19 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/language.support/support.limits/version.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 11 | 12 | #include 13 | 14 | #include "test_macros.h" 15 | 16 | int main(int, char**) 17 | { 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/meta/meta.trans/meta.trans.other/enable_if.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // type_traits 10 | 11 | // enable_if 12 | 13 | #include 14 | 15 | int main(int, char**) 16 | { 17 | typedef cuda::std::enable_if::type A; 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /docs/libcudacxx/extended_api/shapes.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-extended-api-memory-access-shapes: 2 | 3 | Shapes 4 | ====== 5 | 6 | .. toctree:: 7 | :hidden: 8 | :maxdepth: 1 9 | 10 | shapes/aligned_size_t 11 | 12 | .. list-table:: 13 | :widths: 25 45 30 14 | :header-rows: 0 15 | 16 | * - `cuda::std::size_t `_ 17 | - Defines an extent of bytes 18 | - libcu++ 1.0.0 / CCCL 2.0.0 / CUDA 10.2 19 | * - :ref:`cuda::aligned_size_t ` 20 | - Defines an extent of bytes with a statically defined alignment. 21 | - libcu++ 1.2.0 / CCCL 2.0.0 / CUDA 11.1 22 | -------------------------------------------------------------------------------- /.upstream-tests/utils/libcudacxx/sym_check/__init__.py: -------------------------------------------------------------------------------- 1 | #===----------------------------------------------------------------------===## 2 | # 3 | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | # See https://llvm.org/LICENSE.txt for license information. 5 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | # 7 | #===----------------------------------------------------------------------===## 8 | 9 | """libcxx abi symbol checker""" 10 | 11 | __author__ = 'Eric Fiselier' 12 | __email__ = 'eric@efcs.ca' 13 | __versioninfo__ = (0, 1, 0) 14 | __version__ = ' '.join(str(v) for v in __versioninfo__) + 'dev' 15 | 16 | __all__ = ['diff', 'extract', 'util'] 17 | -------------------------------------------------------------------------------- /include/cuda/version: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of libcu++, the C++ Standard Library for your entire system, 4 | // under the Apache License v2.0 with LLVM Exceptions. 5 | // See https://llvm.org/LICENSE.txt for license information. 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 8 | // 9 | //===----------------------------------------------------------------------===// 10 | 11 | #ifndef _CUDA_VERSION 12 | #define _CUDA_VERSION 13 | 14 | #include // IWYU pragma: export 15 | 16 | #endif // _CUDA_VERSION 17 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/memory/smartptr/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.general/nothing_to_do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of libcu++, the C++ Standard Library for your entire system, 4 | // under the Apache License v2.0 with LLVM Exceptions. 5 | // See https://llvm.org/LICENSE.txt for license information. 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 | // SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. 8 | // 9 | //===----------------------------------------------------------------------===// 10 | int main(int, char**) 11 | { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /docs/libcudacxx/standard_api/utility_library/utility.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-standard-api-utility-utility: 2 | 3 | 4 | ====================== 5 | 6 | See the documentation of the standard header `\ `_ 7 | 8 | Extensions 9 | ---------- 10 | 11 | - ``pair`` has been made ``trivially_copyable`` in 2.3.0 12 | 13 | Omissions 14 | --------- 15 | 16 | Prior to version 2.3.0 only ``pair`` is available. 17 | 18 | Since 2.3.0 we have implemented almost all functionality of 19 | ````. Notably support for operator spaceship is missing due to 20 | the specification relying on ``std`` types that are not accessible on 21 | device. 22 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/language.support/support.types/nullptr_t_integral_cast.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // typedef decltype(nullptr) nullptr_t; 10 | 11 | #include 12 | 13 | int main(int, char**) 14 | { 15 | cuda::std::ptrdiff_t i = static_cast(nullptr); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /docs/python.rst: -------------------------------------------------------------------------------- 1 | .. _cccl-python-libraries: 2 | 3 | CUDA Python Core Libraries 4 | ========================== 5 | 6 | .. toctree:: 7 | :hidden: 8 | :maxdepth: 3 9 | 10 | cuda.cooperative 11 | cuda.parallel 12 | 13 | Welcome to the CUDA Core Compute Libraries (CCCL) libraries for Python. 14 | 15 | - `cuda.cooperative `__ 16 | is a still-experimental library exposing cooperative algorithms to Python. 17 | 18 | - `cuda.parallel `__ 19 | is a still-experimental library exposing parallel algorithms to Python. 20 | -------------------------------------------------------------------------------- /.upstream-tests/test/libcxx/utilities/meta/version.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | #include 12 | 13 | #include "test_macros.h" 14 | 15 | #ifndef _LIBCUDACXX_VERSION 16 | # error _LIBCUDACXX_VERSION not defined 17 | #endif 18 | 19 | int main(int, char**) 20 | { 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/meta/meta.trans/meta.trans.other/enable_if2.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // UNSUPPORTED: c++98, c++03, c++11 10 | // type_traits 11 | 12 | // enable_if 13 | 14 | #include 15 | 16 | int main(int, char**) 17 | { 18 | typedef cuda::std::enable_if_t A; 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.hms/time.hms.nonmembers/nothing.to.do.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // template class hh_mm_ss; 12 | 13 | #include 14 | #include 15 | 16 | #include "test_macros.h" 17 | 18 | int main(int, char**) 19 | { 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /.upstream-tests/test/support/nvrtc_limit_macros.h: -------------------------------------------------------------------------------- 1 | #define FLT_RADIX 2 2 | 3 | #define FLT_MIN 1.1754943e-38f 4 | #define FLT_MAX 3.4028234e38f 5 | #define FLT_MIN_EXP -125 6 | #define FLT_MIN_10_EXP -37 7 | #define FLT_MAX_EXP 128 8 | #define FLT_MAX_10_EXP 38 9 | #define FLT_MANT_DIG 24 10 | #define FLT_EPSILON __FLT_EPSILON__ 11 | #define FLT_DIG 6 12 | 13 | #define DBL_MIN 2.2250738585072013e-308 14 | #define DBL_MAX 1.7976931348623157e308 15 | #define DBL_MIN_EXP -1021 16 | #define DBL_MIN_10_EXP -307 17 | #define DBL_MAX_EXP 1024 18 | #define DBL_MAX_10_EXP 308 19 | #define DBL_MANT_DIG 53 20 | #define DBL_EPSILON __DBL_EPSILON__ 21 | #define DBL_DIG 15 22 | -------------------------------------------------------------------------------- /._upstream/.upstream-tests/atomic_codegen/atomic_store_non_volatile.cu: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | __global__ void store_relaxed_device_non_volatile(int* data, int in) 4 | { 5 | auto ref = cuda::atomic_ref{*(data)}; 6 | ref.store(in, cuda::std::memory_order_relaxed); 7 | } 8 | 9 | /* 10 | 11 | ; SM8X-LABEL: .target sm_80 12 | ; SM8X: .visible .entry [[FUNCTION:_.*store_relaxed_device_non_volatile.*]]( 13 | ; SM8X-DAG: ld.param.u64 %rd[[#ATOM:]], [[[FUNCTION]]_param_0]; 14 | ; SM8X-DAG: ld.param.u32 %r[[#INPUT:]], [[[FUNCTION]]_param_1]; 15 | ; SM8X-NEXT: // 16 | ; SM8X-NEXT: st.relaxed.gpu.b32 [%rd[[#ATOM]]],%r[[#INPUT]]; 17 | ; SM8X-NEXT: // 18 | ; SM8X-NEXT: ret; 19 | 20 | */ 21 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/ratio/ratio.ratio/ratio1.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // test ratio: The template argument D shall not be zero 10 | 11 | #include 12 | #include 13 | 14 | int main(int, char**) 15 | { 16 | const cuda::std::intmax_t t1 = cuda::std::ratio<1, 0>::num; 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /docs/libcudacxx/standard_api/utility_library/tuple.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-standard-api-utility-tuple: 2 | 3 | 4 | ==================== 5 | 6 | See the documentation of the standard header `\ `_ 7 | 8 | Restrictions 9 | ------------ 10 | 11 | Before version 1.4.0, ``tuple`` is not available when using NVCC with 12 | MSVC as a host compiler, due to compiler bugs. 13 | 14 | Before version 2.3.0 internal compiler errors may be encountered when 15 | using ``tuple`` with older updates of MSVC 2017 and MSVC 2019. For MSVC 16 | 2017, please use version 15.8 or later (``_MSC_VER >= 1915``). For MSVC 17 | 2019, please use version 16.6 or later (``_MSC_VER >= 1926``). 18 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/containers/sequences/array/array.zero/tested_elsewhere.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of libcu++, the C++ Standard Library for your entire system, 4 | // under the Apache License v2.0 with LLVM Exceptions. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // 11 | 12 | // support for zero-sized array 13 | 14 | #include 15 | 16 | #include "test_macros.h" 17 | 18 | int main(int, char**) 19 | { 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/ratio/ratio.arithmetic/ratio_add.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // test ratio_add 10 | 11 | #include 12 | 13 | int main(int, char**) 14 | { 15 | typedef cuda::std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; 16 | typedef cuda::std::ratio<1, 1> R2; 17 | typedef cuda::std::ratio_add::type R; 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/ratio/ratio.arithmetic/ratio_divide.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // test ratio_divide 10 | 11 | #include 12 | 13 | int main(int, char**) 14 | { 15 | typedef cuda::std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; 16 | typedef cuda::std::ratio<1, 2> R2; 17 | typedef cuda::std::ratio_divide::type R; 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/memory/sanity.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of libcu++, the C++ Standard Library for your entire system, 4 | // under the Apache License v2.0 with LLVM Exceptions. 5 | // See https://llvm.org/LICENSE.txt for license information. 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 8 | // 9 | //===----------------------------------------------------------------------===// 10 | 11 | // 12 | 13 | // template T* addressof(T& r); 14 | 15 | #include 16 | 17 | int main(int, char**) 18 | { 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/ratio/ratio.arithmetic/ratio_multiply.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // test ratio_multiply 10 | 11 | #include 12 | 13 | int main(int, char**) 14 | { 15 | typedef cuda::std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; 16 | typedef cuda::std::ratio<2, 1> R2; 17 | typedef cuda::std::ratio_multiply::type R; 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /docs/libcudacxx/extended_api/synchronization_primitives/pipeline/consumer_release.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-extended-api-synchronization-pipeline-pipeline-consumer-release: 2 | 3 | cuda::pipeline::consumer_release 4 | ==================================== 5 | 6 | Defined in header ````: 7 | 8 | .. code:: cuda 9 | 10 | template 11 | __host__ __device__ 12 | void cuda::pipeline::consumer_release(); 13 | 14 | Releases the current *pipeline stage*. 15 | 16 | .. note:: 17 | 18 | - If the calling thread is a *producer thread*, the behavior is undefined. 19 | - If the pipeline is in a :ref:`quitted state `, 20 | the behavior is undefined. 21 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/ratio/ratio.arithmetic/ratio_subtract.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // test ratio_subtract 10 | 11 | #include 12 | 13 | int main(int, char**) 14 | { 15 | typedef cuda::std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; 16 | typedef cuda::std::ratio<1, 1> R2; 17 | typedef cuda::std::ratio_subtract::type R; 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /ci/test_libhipcxx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source "$(dirname "$0")/build_common.sh" 4 | 5 | print_environment_details 6 | 7 | PRESET="libcudacxx-cpp${CXX_STANDARD}" 8 | CMAKE_OPTIONS="" 9 | 10 | configure_preset libcudacxx "$PRESET" "$CMAKE_OPTIONS" 11 | 12 | # The libcudacxx tests are split into two presets, one for 13 | # regular ctest tests and another that invokes the lit tests 14 | # harness with extra options for verbosity, etc: 15 | CTEST_PRESET="libcudacxx-ctest-cpp${CXX_STANDARD}" 16 | LIT_PRESET="libcudacxx-lit-cpp${CXX_STANDARD}" 17 | 18 | test_preset "libcudacxx (CTest)" ${CTEST_PRESET} 19 | 20 | source "./sccache_stats.sh" "start" 21 | test_preset "libcudacxx (lit)" ${LIT_PRESET} 22 | source "./sccache_stats.sh" "end" 23 | 24 | print_time_summary 25 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/numerics/complex.number/ccmplx/ccomplex.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // 11 | 12 | #include 13 | 14 | #include "test_macros.h" 15 | 16 | int main(int, char**) 17 | { 18 | cuda::std::complex d; 19 | unused(d); 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/function.objects/func.require/INVOKE_tested_elsewhere.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // INVOKE (f, t1, t2, ..., tN) 10 | 11 | // The tests for INVOKE (f, t1, t2, ..., tN) live in the "test/libcxx" tree 12 | // since they require calling the implementation specific "__invoke" and 13 | // "__invoke" functions. 14 | 15 | int main(int, char**) 16 | { 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /.upstream-tests/test/libcxx/atomics/libcpp-has-no-threads.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // XFAIL: libcpp-has-no-threads 9 | 10 | #ifdef _LIBCUDACXX_HAS_NO_THREADS 11 | # error This should be XFAILed for the purpose of detecting that the LIT feature\ 12 | 'libcpp-has-no-threads' is available iff _LIBCUDACXX_HAS_NO_THREADS is defined 13 | #endif 14 | 15 | int main(int, char**) 16 | { 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /docs/libcudacxx/extended_api/synchronization_primitives/pipeline/producer_acquire.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-extended-api-synchronization-pipeline-pipeline-producer-aquire: 2 | 3 | cuda::pipeline::producer_acquire 4 | ==================================== 5 | 6 | Defined in header ````: 7 | 8 | .. code:: cuda 9 | 10 | template 11 | __host__ __device__ 12 | void cuda::pipeline::producer_acquire(); 13 | 14 | Blocks the current thread until the next *pipeline stage* is available. 15 | 16 | .. note:: 17 | 18 | - If the calling thread is a *consumer thread*, the behavior is undefined. 19 | - If the pipeline is in a :ref:`quitted state `, 20 | the behavior is undefined. 21 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // UNSUPPORTED: c++98, c++03 10 | 11 | // type_traits 12 | 13 | // aligned_union 14 | 15 | #include 16 | 17 | class A; // Incomplete 18 | 19 | int main(int, char**) 20 | { 21 | typedef cuda::std::aligned_union<10, A>::type T1; 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /.upstream-tests/test/libcxx/atomics/version.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // 9 | // UNSUPPORTED: libcpp-has-no-threads, pre-sm-60 10 | // UNSUPPORTED: windows && pre-sm-70 11 | 12 | // 13 | 14 | #include 15 | 16 | #include "test_macros.h" 17 | 18 | #ifndef _LIBCUDACXX_VERSION 19 | # error _LIBCUDACXX_VERSION not defined 20 | #endif 21 | 22 | int main(int, char**) 23 | { 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # Exclude these commits from git-blame and similar tools. 2 | # 3 | # To use this file, run the following command from the repo root: 4 | # 5 | # ``` 6 | # $ git config blame.ignoreRevsFile .git-blame-ignore-revs 7 | # ``` 8 | # 9 | # Include a brief comment with each commit added, for example: 10 | # 11 | # ``` 12 | # 8f1152d4a22287a35be2dde596e3cf86ace8054a # Increase column limit to 100 13 | # ``` 14 | # 15 | # Only add commits that are pure formatting changes (e.g. clang-format version changes, etc). 16 | 17 | # Apply formatting to thrust (#1616) 18 | 165a06aa2c50b98d50fa56d027f0674da9d382e4 19 | 20 | # Apply formatting to libcudacxx (#1610) 21 | baee3f502d4fd5febc7f602428592b2bec5d2d3b 22 | 23 | # Apply clang-format to cub (#1602) 24 | eefcca862226672eae8eacb244f39f2e7b4bf7c4 25 | -------------------------------------------------------------------------------- /docs/libcudacxx/extended_api/synchronization_primitives/pipeline/producer_commit.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-extended-api-synchronization-pipeline-pipeline-producer-commit: 2 | 3 | cuda::pipeline::producer_commit 4 | =================================== 5 | 6 | Defined in header ````: 7 | 8 | .. code:: cuda 9 | 10 | template 11 | __host__ __device__ 12 | void cuda::pipeline::producer_commit(); 13 | 14 | Commits operations previously issued by the current thread to the current *pipeline stage*. 15 | 16 | .. note:: 17 | 18 | - If the calling thread is a *consumer thread*, the behavior is undefined. 19 | - If the pipeline is in a :ref:`quitted state `, 20 | the behavior is undefined. 21 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/language.support/support.dynamic/ptr.launder/launder.nodiscard.verify.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // template constexpr T* launder(T* p) noexcept; 12 | 13 | #include 14 | 15 | __host__ __device__ void f() 16 | { 17 | int* p = nullptr; 18 | cuda::std::launder(p); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} 19 | } 20 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/language.support/support.types/offsetof.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // UNSUPPORTED: c++98, c++03 10 | 11 | #include 12 | 13 | #include "test_macros.h" 14 | 15 | #ifndef offsetof 16 | # error offsetof not defined 17 | #endif 18 | 19 | struct A 20 | { 21 | int x; 22 | }; 23 | 24 | int main(int, char**) 25 | { 26 | static_assert(noexcept(offsetof(A, x)), ""); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/ratio/ratio.ratio/ratio2.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // test ratio: the absolute values of the template arguments N and D 10 | // shall be representable by type intmax_t. 11 | 12 | #include 13 | #include 14 | 15 | int main(int, char**) 16 | { 17 | const cuda::std::intmax_t t1 = cuda::std::ratio<0x8000000000000000ULL, 1>::num; 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/ratio/ratio.ratio/ratio3.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // test ratio: the absolute values of the template arguments N and D 10 | // shall be representable by type intmax_t. 11 | 12 | #include 13 | #include 14 | 15 | int main(int, char**) 16 | { 17 | const cuda::std::intmax_t t1 = cuda::std::ratio<1, 0x8000000000000000ULL>::num; 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.clock/time.clock.system/rep_signed.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // system_clock 12 | 13 | // rep should be signed 14 | 15 | #include 16 | #include 17 | 18 | int main(int, char**) 19 | { 20 | assert(cuda::std::chrono::system_clock::duration::min() < cuda::std::chrono::system_clock::duration::zero()); 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/intseq/intseq.make/make_integer_seq_fallback.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // 11 | 12 | // template 13 | // using make_integer_sequence = integer_sequence; 14 | 15 | #define _LIBCUDACXX_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE 16 | #include "make_integer_seq.pass.cpp" 17 | #include "test_macros.h" 18 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/utility/utility.unreachable/unreachable.verify.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 11 | 12 | #include 13 | 14 | [[noreturn]] void unreachable() 15 | { 16 | cuda::std::unreachable(); 17 | } // expected-no-diagnostics 18 | 19 | int main(int, char**) 20 | { 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /docs/libcudacxx/standard_api/utility_library/variant.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-standard-api-utility-variant: 2 | 3 | 4 | ====================== 5 | 6 | See the documentation of the standard header `\ `_ 7 | 8 | Extensions 9 | ---------- 10 | 11 | - All features are available from C++14 onwards. 12 | - All features are available at compile time if the different value types support it. 13 | 14 | Restrictions 15 | ------------ 16 | 17 | - On device no exceptions are thrown in case of a bad access. 18 | 19 | Cuda specific changes 20 | --------------------- 21 | 22 | - ``cuda::std::visit`` utilizes recursion instead of the usual function 23 | pointer array. This greatly improves runtime behavior, but comes at 24 | the cost of increased compile times. 25 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.clock/time.clock.system/to_time_t.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // system_clock 12 | 13 | // time_t to_time_t(const time_point& t); 14 | 15 | #include 16 | #include 17 | 18 | int main(int, char**) 19 | { 20 | typedef cuda::std::chrono::system_clock C; 21 | cuda::std::time_t t1 = C::to_time_t(C::now()); 22 | ((void) t1); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/clock.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #ifndef CLOCK_H 10 | #define CLOCK_H 11 | 12 | #include 13 | 14 | class Clock 15 | { 16 | typedef std::chrono::nanoseconds duration; 17 | typedef duration::rep rep; 18 | typedef duration::period period; 19 | typedef std::chrono::time_point time_point; 20 | static const bool is_steady = false; 21 | 22 | static time_point now(); 23 | }; 24 | 25 | #endif // CLOCK_H 26 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type2.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // UNSUPPORTED: c++98, c++03, c++11 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | int main(int, char**) 16 | { 17 | typedef cuda::std::complex cf; 18 | auto t1 = cuda::std::make_pair(42, 43); 19 | assert(cuda::std::get(t1) == 42); // two ints 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/utility/utility.unreachable/unreachable.compile.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 11 | 12 | #include 13 | #include 14 | 15 | static_assert(cuda::std::is_same_v); 16 | 17 | int main(int, char**) 18 | { 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /.upstream-tests/test/support/truncate_fp.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | __host__ __device__ inline long double truncate_fp(long double val) 10 | { 11 | volatile long double sink = val; 12 | return sink; 13 | } 14 | 15 | __host__ __device__ inline double truncate_fp(double val) 16 | { 17 | volatile double sink = val; 18 | return sink; 19 | } 20 | 21 | __host__ __device__ inline float truncate_fp(float val) 22 | { 23 | volatile float sink = val; 24 | return sink; 25 | } 26 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.clock/time.clock.system/from_time_t.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // system_clock 12 | 13 | // static time_point from_time_t(time_t t); 14 | 15 | #include 16 | #include 17 | 18 | int main(int, char**) 19 | { 20 | typedef cuda::std::chrono::system_clock C; 21 | C::time_point t1 = C::from_time_t(C::to_time_t(C::now())); 22 | ((void) t1); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type1.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // UNSUPPORTED: c++98, c++03, c++11 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | int main(int, char**) 16 | { 17 | typedef cuda::std::complex cf; 18 | auto t1 = cuda::std::make_pair(42, 3.4); 19 | assert((cuda::std::get(t1) == cf{1, 2})); // no such type 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /._upstream/.upstream-tests/atomic_codegen/atomic_load_non_volatile.cu: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | __global__ void load_relaxed_device_non_volatile(int* data, int* out) 4 | { 5 | auto ref = cuda::atomic_ref{*(data)}; 6 | *out = ref.load(cuda::std::memory_order_relaxed); 7 | } 8 | 9 | /* 10 | 11 | ; SM8X-LABEL: .target sm_80 12 | ; SM8X: .visible .entry [[FUNCTION:_.*load_relaxed_device_non_volatile.*]]( 13 | ; SM8X-DAG: ld.param.u64 %rd[[#ATOM:]], [[[FUNCTION]]_param_0]; 14 | ; SM8X-DAG: ld.param.u64 %rd[[#EXPECTED:]], [[[FUNCTION]]_param_1]; 15 | ; SM8X-NEXT: cvta.to.global.u64 %rd[[#GOUT:]], %rd[[#EXPECTED]]; 16 | ; SM8X-NEXT: // 17 | ; SM8X-NEXT: ld.relaxed.gpu.b32 %r[[#DEST:]],[%rd[[#ATOM]]]; 18 | ; SM8X-NEXT: // 19 | ; SM8X-NEXT: st.global.u32 [%rd[[#GOUT]]], %r[[#DEST]]; 20 | ; SM8X-NEXT: ret; 21 | 22 | */ 23 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/atomics/atomics.fences/atomic_signal_fence.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // 9 | // UNSUPPORTED: libcpp-has-no-threads, pre-sm-60 10 | // UNSUPPORTED: windows && pre-sm-70 11 | 12 | // 13 | 14 | // void atomic_signal_fence(memory_order m); 15 | 16 | #include 17 | 18 | #include "test_macros.h" 19 | 20 | int main(int, char**) 21 | { 22 | cuda::std::atomic_signal_fence(cuda::std::memory_order_seq_cst); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/atomics/atomics.fences/atomic_thread_fence.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // 9 | // UNSUPPORTED: libcpp-has-no-threads, pre-sm-60 10 | // UNSUPPORTED: windows && pre-sm-70 11 | 12 | // 13 | 14 | // void atomic_thread_fence(memory_order m); 15 | 16 | #include 17 | 18 | #include "test_macros.h" 19 | 20 | int main(int, char**) 21 | { 22 | cuda::std::atomic_thread_fence(cuda::std::memory_order_seq_cst); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.duration/time.duration.literals/literals1.fail.cpp: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | //===----------------------------------------------------------------------===// 3 | // 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5 | // See https://llvm.org/LICENSE.txt for license information. 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // UNSUPPORTED: c++98, c++03, c++11 11 | 12 | // .fail. expects compilation to fail, but this would only fail at runtime with NVRTC 13 | 14 | #include 15 | #include 16 | 17 | int main(int, char**) 18 | { 19 | cuda::std::chrono::hours h = 4h; // should fail w/conversion operator not found 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.point/duration.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // time_point 12 | 13 | // Duration shall be an instance of duration. 14 | 15 | // .fail. expects compilation to fail, but this would only fail at runtime with NVRTC 16 | 17 | #include 18 | 19 | int main(int, char**) 20 | { 21 | typedef cuda::std::chrono::time_point T; 22 | T t; 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/iterator.primitives/iterator.basic/deprecated.verify.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // UNSUPPORTED: c++03, c++11, c++14 11 | 12 | // cuda::std::iterator 13 | 14 | #include 15 | 16 | cuda::std::iterator it; // expected-warning-re {{'iterator<{{.+}}>' is deprecated}} 17 | 18 | int main(int, char**) 19 | { 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/function.objects/negators/not1.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | // UNSUPPORTED: c++20 11 | 12 | // not1 13 | 14 | #define _LIBCUDACXX_DISABLE_DEPRECATION_WARNINGS 15 | 16 | #include 17 | #include 18 | 19 | int main(int, char**) 20 | { 21 | typedef cuda::std::logical_not F; 22 | assert(cuda::std::not1(F())(36)); 23 | assert(!cuda::std::not1(F())(0)); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/memory/smartptr/unique.ptr/README.TXT: -------------------------------------------------------------------------------- 1 | Test Naming and Directory Structure 2 | =================================== 3 | 4 | The directory structure for the unique_ptr class templates differs from the 5 | normal test directory naming conventions (e.g. matching the stable name in the standard). 6 | 7 | Instead of having a [unique.ptr.single] and [unique.ptr.runtime] directory, 8 | each containing their own tests, a single directory, "unique.ptr.class", 9 | contains both sets of tests. 10 | 11 | This allows the common behavior of the two unique_ptr specializations to be 12 | tested in the same place without duplication. 13 | 14 | Tests specific to [unique.ptr.single] have the suffix ".single.pass.cpp" 15 | and those specific to [unique.ptr.runtime] are named "*.runtime.pass.cpp". 16 | Tests for both specializations are named normally. 17 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.duration/positive_num.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // duration 12 | 13 | // Period::num shall be positive, diagnostic required. 14 | 15 | // .fail. expects compilation to fail, but this would only fail at runtime with NVRTC 16 | 17 | #include 18 | 19 | int main(int, char**) 20 | { 21 | typedef cuda::std::chrono::duration> D; 22 | D d; 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/containers/views/mdspan/mdspan.mdspan.util/mdspan_util.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | #define CHECK_MDSPAN_EXTENT(m, d, e0, e1) \ 11 | static_assert(m.is_exhaustive(), ""); \ 12 | assert(m.data_handle() == d.data()); \ 13 | assert(m.rank() == 2); \ 14 | assert(m.rank_dynamic() == 2); \ 15 | assert(m.extent(0) == e0); \ 16 | assert(m.extent(1) == e1) 17 | -------------------------------------------------------------------------------- /.upstream-tests/test/cuda/version.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of libcu++, the C++ Standard Library for your entire system, 4 | // under the Apache License v2.0 with LLVM Exceptions. 5 | // See https://llvm.org/LICENSE.txt for license information. 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 8 | // 9 | //===----------------------------------------------------------------------===// 10 | 11 | #include 12 | 13 | static_assert(CCCL_MAJOR_VERSION == (CCCL_VERSION / 1000000), ""); 14 | static_assert(CCCL_MINOR_VERSION == (CCCL_VERSION / 1000 % 1000), ""); 15 | static_assert(CCCL_PATCH_VERSION == (CCCL_VERSION % 1000), ""); 16 | 17 | int main(int argc, char** argv) 18 | { 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.bool1.compile.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // 9 | // 10 | 11 | // template 12 | // constexpr common_type_t<_M,_N> gcd(_M __m, _N __n) 13 | 14 | // Remarks: If either M or N is not an integer type, 15 | // or if either is (a possibly cv-qualified) bool, the program is ill-formed. 16 | 17 | #include 18 | 19 | int main(int, char**) 20 | { 21 | cuda::std::gcd(false, 4); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.bool2.compile.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // 9 | // 10 | 11 | // template 12 | // constexpr common_type_t<_M,_N> gcd(_M __m, _N __n) 13 | 14 | // Remarks: If either M or N is not an integer type, 15 | // or if either is (a possibly cv-qualified) bool, the program is ill-formed. 16 | 17 | #include 18 | 19 | int main(int, char**) 20 | { 21 | cuda::std::gcd(2, true); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.bool1.compile.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // 9 | // 10 | 11 | // template 12 | // constexpr common_type_t<_M,_N> lcm(_M __m, _N __n) 13 | 14 | // Remarks: If either M or N is not an integer type, 15 | // or if either is (a possibly cv-qualified) bool, the program is ill-formed. 16 | 17 | #include 18 | 19 | int main(int, char**) 20 | { 21 | cuda::std::lcm(false, 4); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.bool2.compile.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // 9 | // 10 | 11 | // template 12 | // constexpr common_type_t<_M,_N> lcm(_M __m, _N __n) 13 | 14 | // Remarks: If either M or N is not an integer type, 15 | // or if either is (a possibly cv-qualified) bool, the program is ill-formed. 16 | 17 | #include 18 | 19 | int main(int, char**) 20 | { 21 | cuda::std::lcm(2, true); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/variant/variant.synopsis/variant_npos.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // UNSUPPORTED: c++03, c++11 10 | // UNSUPPORTED: msvc-19.16 11 | // UNSUPPORTED: clang-7, clang-8 12 | 13 | // 14 | 15 | // constexpr size_t variant_npos = -1; 16 | 17 | #include 18 | 19 | #include "test_macros.h" 20 | 21 | int main(int, char**) 22 | { 23 | static_assert(cuda::std::variant_npos == static_cast(-1), ""); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /._upstream/.github/workflows/workflow-dispatch-two-stage-group-linux.yml: -------------------------------------------------------------------------------- 1 | name: "Workflow/Dispatch/TwoStageGroup/Linux" 2 | 3 | defaults: 4 | run: 5 | shell: bash --noprofile --norc -euo pipefail {0} 6 | 7 | on: 8 | workflow_call: 9 | inputs: 10 | pc-array: 11 | description: "The dispatch.json's linux_two_stage.jobs. array of producer/consumer chains." 12 | type: string 13 | required: true 14 | 15 | jobs: 16 | dispatch-pcs: 17 | name: ${{ matrix.id }} 18 | permissions: 19 | id-token: write 20 | contents: read 21 | strategy: 22 | fail-fast: false 23 | matrix: 24 | include: ${{ fromJSON(inputs.pc-array) }} 25 | uses: ./.github/workflows/workflow-dispatch-two-stage-linux.yml 26 | with: 27 | producers: ${{ toJSON(matrix.producers) }} 28 | consumers: ${{ toJSON(matrix.consumers) }} 29 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.not_integral1.compile.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // 9 | // 10 | 11 | // template 12 | // constexpr common_type_t<_M,_N> gcd(_M __m, _N __n) 13 | 14 | // Remarks: If either M or N is not an integer type, 15 | // or if either is (a possibly cv-qualified) bool, the program is ill-formed. 16 | 17 | #include 18 | 19 | int main(int, char**) 20 | { 21 | cuda::std::gcd(2.0, 4); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.not_integral2.compile.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // 9 | // 10 | 11 | // template 12 | // constexpr common_type_t<_M,_N> gcd(_M __m, _N __n) 13 | 14 | // Remarks: If either M or N is not an integer type, 15 | // or if either is (a possibly cv-qualified) bool, the program is ill-formed. 16 | 17 | #include 18 | 19 | int main(int, char**) 20 | { 21 | cuda::std::gcd(4, 6.0); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.not_integral1.compile.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // 9 | // 10 | 11 | // template 12 | // constexpr common_type_t<_M,_N> lcm(_M __m, _N __n) 13 | 14 | // Remarks: If either M or N is not an integer type, 15 | // or if either is (a possibly cv-qualified) bool, the program is ill-formed. 16 | 17 | #include 18 | 19 | int main(int, char**) 20 | { 21 | cuda::std::lcm(2.0, 4); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.not_integral2.compile.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // 9 | // 10 | 11 | // template 12 | // constexpr common_type_t<_M,_N> lcm(_M __m, _N __n) 13 | 14 | // Remarks: If either M or N is not an integer type, 15 | // or if either is (a possibly cv-qualified) bool, the program is ill-formed. 16 | 17 | #include 18 | 19 | int main(int, char**) 20 | { 21 | cuda::std::lcm(4, 6.0); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.ref/deprecated.verify.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // UNSUPPORTED: c++03, c++11, c++14, c++17 11 | 12 | // move_iterator 13 | 14 | #include 15 | 16 | int main(int, char**) 17 | { 18 | (void) cuda::std::move_iterator().operator->(); 19 | // expected-warning@-1{{'operator->' is deprecated}} 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.duration/time.duration.literals/literals2.fail.cpp: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | //===----------------------------------------------------------------------===// 3 | // 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5 | // See https://llvm.org/LICENSE.txt for license information. 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // UNSUPPORTED: c++98, c++03, c++11 11 | 12 | // .fail. expects compilation to fail, but this would only fail at runtime with NVRTC 13 | 14 | #include 15 | #include 16 | 17 | int main(int, char**) 18 | { 19 | using cuda::std::chrono::hours; 20 | 21 | hours foo = 4h; // should fail w/conversion operator not found 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /._upstream/.github/workflows/workflow-dispatch-two-stage-group-windows.yml: -------------------------------------------------------------------------------- 1 | name: "Workflow/Dispatch/TwoStageGroup/Windows" 2 | 3 | defaults: 4 | run: 5 | shell: bash --noprofile --norc -euo pipefail {0} 6 | 7 | on: 8 | workflow_call: 9 | inputs: 10 | pc-array: 11 | description: "The dispatch.json's windows_two_stage.jobs. array of producer/consumer chains." 12 | type: string 13 | required: true 14 | 15 | jobs: 16 | dispatch-pcs: 17 | name: ${{ matrix.id }} 18 | permissions: 19 | id-token: write 20 | contents: read 21 | strategy: 22 | fail-fast: false 23 | matrix: 24 | include: ${{ fromJSON(inputs.pc-array) }} 25 | uses: ./.github/workflows/workflow-dispatch-two-stage-windows.yml 26 | with: 27 | producers: ${{ toJSON(matrix.producers) }} 28 | consumers: ${{ toJSON(matrix.consumers) }} 29 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.bool4.compile.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // 9 | // 10 | 11 | // template 12 | // constexpr common_type_t<_M,_N> gcd(_M __m, _N __n) 13 | 14 | // Remarks: If either M or N is not an integer type, 15 | // or if either is (a possibly cv-qualified) bool, the program is ill-formed. 16 | 17 | #include 18 | 19 | int main(int, char**) 20 | { 21 | cuda::std::gcd(2, true); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.bool4.compile.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // 9 | // 10 | 11 | // template 12 | // constexpr common_type_t<_M,_N> lcm(_M __m, _N __n) 13 | 14 | // Remarks: If either M or N is not an integer type, 15 | // or if either is (a possibly cv-qualified) bool, the program is ill-formed. 16 | 17 | #include 18 | 19 | int main(int, char**) 20 | { 21 | cuda::std::lcm(2, true); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.cal/time.cal.day/types.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // UNSUPPORTED: c++98, c++03, c++11 9 | 10 | // 11 | // class day; 12 | 13 | #include 14 | #include 15 | 16 | #include "test_macros.h" 17 | 18 | int main(int, char**) 19 | { 20 | using day = cuda::std::chrono::day; 21 | 22 | static_assert(cuda::std::is_trivially_copyable_v, ""); 23 | static_assert(cuda::std::is_standard_layout_v, ""); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.bool3.compile.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // 9 | // 10 | 11 | // template 12 | // constexpr common_type_t<_M,_N> gcd(_M __m, _N __n) 13 | 14 | // Remarks: If either M or N is not an integer type, 15 | // or if either is (a possibly cv-qualified) bool, the program is ill-formed. 16 | 17 | #include 18 | 19 | int main(int, char**) 20 | { 21 | cuda::std::gcd(false, 4); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.bool3.compile.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // 9 | // 10 | 11 | // template 12 | // constexpr common_type_t<_M,_N> lcm(_M __m, _N __n) 13 | 14 | // Remarks: If either M or N is not an integer type, 15 | // or if either is (a possibly cv-qualified) bool, the program is ill-formed. 16 | 17 | #include 18 | 19 | int main(int, char**) 20 | { 21 | cuda::std::lcm(false, 4); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/function.objects/refwrap/refwrap.const/type_ctor.compile.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // 11 | 12 | // reference_wrapper 13 | 14 | // reference_wrapper(T&&) = delete; 15 | 16 | // #include 17 | #include 18 | #include 19 | 20 | int main(int, char**) 21 | { 22 | cuda::std::reference_wrapper r(3); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.cal/time.cal.year/types.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // UNSUPPORTED: c++98, c++03, c++11 9 | 10 | // 11 | // class year; 12 | 13 | #include 14 | #include 15 | 16 | #include "test_macros.h" 17 | 18 | int main(int, char**) 19 | { 20 | using year = cuda::std::chrono::year; 21 | 22 | static_assert(cuda::std::is_trivially_copyable_v, ""); 23 | static_assert(cuda::std::is_standard_layout_v, ""); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.cal/time.cal.month/types.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // UNSUPPORTED: c++98, c++03, c++11 9 | 10 | // 11 | // class month; 12 | 13 | #include 14 | #include 15 | 16 | #include "test_macros.h" 17 | 18 | int main(int, char**) 19 | { 20 | using month = cuda::std::chrono::month; 21 | 22 | static_assert(cuda::std::is_trivially_copyable_v, ""); 23 | static_assert(cuda::std::is_standard_layout_v, ""); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /docs/libcudacxx/standard_api/utility_library/version.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-standard-api-utility-version: 2 | 3 | 4 | ====================== 5 | 6 | See the documentation of the standard header `\ `_ 7 | 8 | Extensions 9 | ---------- 10 | 11 | The following version macros, which are explained in the :ref:`versioning section `, 12 | are defined in this header: 13 | 14 | - ``_LIBCUDACXX_CUDA_API_VERSION`` 15 | - ``_LIBCUDACXX_CUDA_API_VERSION_MAJOR`` 16 | - ``_LIBCUDACXX_CUDA_API_VERSION_MINOR`` 17 | - ``_LIBCUDACXX_CUDA_API_VERSION_PATCH`` 18 | - ``_LIBCUDACXX_CUDA_ABI_VERSION`` 19 | - ``_LIBCUDACXX_CUDA_ABI_VERSION_LATEST`` 20 | 21 | Restrictions 22 | ------------ 23 | 24 | When using NVCC, the definition of C++ feature test macros is provided 25 | by the host Standard Library, not libcu++. 26 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/copy.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // template class tuple; 12 | 13 | // tuple(const tuple& u) = default; 14 | 15 | // UNSUPPORTED: c++98, c++03 16 | 17 | #include 18 | #include 19 | 20 | #include "MoveOnly.h" 21 | 22 | int main(int, char**) 23 | { 24 | { 25 | typedef cuda::std::tuple T; 26 | T t0(MoveOnly(2)); 27 | T t = t0; 28 | } 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.clock/time.clock.system/now.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // system_clock 12 | 13 | // static time_point now(); 14 | 15 | #include 16 | #include 17 | 18 | int main(int, char**) 19 | { 20 | typedef cuda::std::chrono::system_clock C; 21 | C::time_point t1 = C::now(); 22 | assert(t1.time_since_epoch().count() != 0); 23 | assert(C::time_point::min() < t1); 24 | assert(C::time_point::max() > t1); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.duration/time.duration.cons/rep01.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // duration 12 | 13 | // template 14 | // explicit duration(const Rep2& r); 15 | 16 | // test for explicit 17 | 18 | // .fail. expects compilation to fail, but this would only fail at runtime with NVRTC 19 | 20 | #include 21 | 22 | #include "../../rep.h" 23 | 24 | int main(int, char**) 25 | { 26 | cuda::std::chrono::duration d = 1; 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.duration/time.duration.cons/rep03.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // duration 12 | 13 | // template 14 | // explicit duration(const Rep2& r); 15 | 16 | // treat_as_floating_point::value shall be false 17 | 18 | // .fail. expects compilation to fail, but this would only fail at runtime with NVRTC 19 | 20 | #include 21 | 22 | int main(int, char**) 23 | { 24 | cuda::std::chrono::duration d(1.); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types2.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // template class tuple; 12 | 13 | // explicit tuple(const T&...); 14 | 15 | // UNSUPPORTED: c++98, c++03 16 | 17 | #include 18 | #include 19 | 20 | int main(int, char**) 21 | { 22 | // cuda::std::string not supported 23 | { 24 | cuda::std::tuple t(2, nullptr, "text"); 25 | } 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /._upstream/.github/actions/workflow-results/verify-job-success.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import argparse 4 | import json 5 | import os 6 | import sys 7 | 8 | 9 | def main(): 10 | parser = argparse.ArgumentParser() 11 | parser.add_argument("job_id_map", type=argparse.FileType('r')) 12 | args = parser.parse_args() 13 | 14 | job_id_map = json.load(args.job_id_map) 15 | 16 | # For each job id, verify that the success artifact exists 17 | success = True 18 | for job_id, job_name in job_id_map.items(): 19 | success_file = f'jobs/{job_id}/success' 20 | print(f'Verifying job with id "{job_id}": "{job_name}"') 21 | if not os.path.exists(success_file): 22 | print(f'Failed: Artifact "{success_file}" not found') 23 | success = False 24 | 25 | if not success: 26 | sys.exit(1) 27 | 28 | 29 | if __name__ == '__main__': 30 | main() 31 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.cal/time.cal.weekday/types.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // UNSUPPORTED: c++98, c++03, c++11 9 | 10 | // 11 | // class weekday; 12 | 13 | #include 14 | #include 15 | 16 | #include "test_macros.h" 17 | 18 | int main(int, char**) 19 | { 20 | using weekday = cuda::std::chrono::weekday; 21 | 22 | static_assert(cuda::std::is_trivially_copyable_v, ""); 23 | static_assert(cuda::std::is_standard_layout_v, ""); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.assign/copy.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // template class tuple; 12 | 13 | // tuple& operator=(const tuple& u); 14 | 15 | // UNSUPPORTED: c++98, c++03 16 | 17 | #include 18 | #include 19 | 20 | #include "MoveOnly.h" 21 | 22 | int main(int, char**) 23 | { 24 | { 25 | typedef cuda::std::tuple T; 26 | T t0(MoveOnly(2)); 27 | T t; 28 | t = t0; 29 | } 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /docs/libcudacxx/ptx/instructions.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-ptx-instructions: 2 | 3 | PTX Instructions 4 | ================ 5 | 6 | .. toctree:: 7 | :hidden: 8 | :maxdepth: 1 9 | 10 | instructions/barrier.cluster 11 | instructions/cp.async.bulk 12 | instructions/cp.async.bulk.commit_group 13 | instructions/cp.async.bulk.wait_group 14 | instructions/cp.async.bulk.tensor 15 | instructions/cp.reduce.async.bulk 16 | instructions/cp.reduce.async.bulk.tensor 17 | instructions/fence 18 | instructions/getctarank 19 | instructions/mapa 20 | instructions/mbarrier.init 21 | instructions/mbarrier.arrive 22 | instructions/mbarrier.expect_tx 23 | instructions/mbarrier.test_wait 24 | instructions/mbarrier.try_wait 25 | instructions/red.async 26 | instructions/st.async 27 | instructions/tensormap.replace 28 | instructions/tensormap.cp_fenceproxy 29 | instructions/special_registers 30 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/atomics/atomics.order/kill_dependency.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // 9 | // UNSUPPORTED: libcpp-has-no-threads, pre-sm-60 10 | // UNSUPPORTED: windows && pre-sm-70 11 | 12 | // 13 | 14 | // template T kill_dependency(T y); 15 | 16 | #include 17 | #include 18 | 19 | #include "test_macros.h" 20 | 21 | int main(int, char**) 22 | { 23 | assert(cuda::std::kill_dependency(5) == 5); 24 | assert(cuda::std::kill_dependency(-5.5) == -5.5); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/language.support/support.types/nullptr_t_integral_cast.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // NOTE: nullptr_t emulation cannot handle a reinterpret_cast to an 10 | // integral type 11 | // XFAIL: c++98, c++03 12 | 13 | // typedef decltype(nullptr) nullptr_t; 14 | 15 | #include 16 | #include 17 | 18 | #include "test_macros.h" 19 | 20 | int main(int, char**) 21 | { 22 | cuda::std::ptrdiff_t i = reinterpret_cast(nullptr); 23 | assert(i == 0); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/intseq/intseq.make/make_integer_seq_fallback.compile.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // 11 | 12 | // template 13 | // using make_integer_sequence = integer_sequence; 14 | 15 | // This test hangs during recursive template instantiation with libstdc++ 16 | // UNSUPPORTED: stdlib=libstdc++ 17 | 18 | #define _LIBCUDACXX_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE 19 | #include "make_integer_seq.fail.cpp" 20 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.cal/time.cal.md/types.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // UNSUPPORTED: c++98, c++03, c++11 9 | 10 | // 11 | // class month_day; 12 | 13 | #include 14 | #include 15 | 16 | #include "test_macros.h" 17 | 18 | int main(int, char**) 19 | { 20 | using month_day = cuda::std::chrono::month_day; 21 | 22 | static_assert(cuda::std::is_trivially_copyable_v, ""); 23 | static_assert(cuda::std::is_standard_layout_v, ""); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/optional/optional.syn/optional_includes_initializer_list.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // UNSUPPORTED: c++03, c++11 11 | // 12 | 13 | // #include 14 | 15 | #include 16 | 17 | #include "test_macros.h" 18 | 19 | int main(int, char**) 20 | { 21 | using cuda::std::optional; 22 | 23 | cuda::std::initializer_list list; 24 | unused(list); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.clock/time.clock.hires/now.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // high_resolution_clock 12 | 13 | // static time_point now(); 14 | 15 | #include 16 | #include 17 | 18 | int main(int, char**) 19 | { 20 | typedef cuda::std::chrono::high_resolution_clock C; 21 | C::time_point t1 = C::now(); 22 | assert(t1.time_since_epoch().count() != 0); 23 | assert(C::time_point::min() < t1); 24 | assert(C::time_point::max() > t1); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.duration/duration.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // duration 12 | 13 | // If a program instantiates duration with a duration type for the template 14 | // argument Rep a diagnostic is required. 15 | 16 | // .fail. expects compilation to fail, but this would only fail at runtime with NVRTC 17 | 18 | #include 19 | 20 | int main(int, char**) 21 | { 22 | typedef cuda::std::chrono::duration D; 23 | D d; 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/containers/views/views.span/trivially_copyable.compile.pass.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 3 | // See https://llvm.org/LICENSE.txt for license information. 4 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 5 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // UNSUPPORTED: c++03, c++11 10 | 11 | // P2251 was voted into C++23, but is supported even in C++20 mode by all vendors. 12 | 13 | // 14 | 15 | #include 16 | #include 17 | 18 | static_assert(cuda::std::is_trivially_copyable>::value, ""); 19 | static_assert(cuda::std::is_trivially_copyable>::value, ""); 20 | 21 | int main(int, char**) 22 | { 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/utility/pairs/pair.astuple/pairs.by.type3.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // UNSUPPORTED: c++98, c++03, c++11 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | int main(int, char**) 16 | { 17 | // cuda/std/memory not supported, however, with available this test needs to fail. 18 | typedef cuda::std::unique_ptr upint; 19 | cuda::std::pair t(upint(new int(4)), 23); 20 | upint p = cuda::std::get(t); 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /docs/libcudacxx/ptx/instructions/cp.async.bulk.wait_group.rst: -------------------------------------------------------------------------------- 1 | .. _libcudacxx-ptx-instructions-cp-async-bulk-wait_group: 2 | 3 | cp.async.bulk.wait_group 4 | ======================== 5 | 6 | - PTX ISA: 7 | `cp.async.bulk.wait_group `__ 8 | 9 | cp.async.bulk.wait_group 10 | ^^^^^^^^^^^^^^^^^^^^^^^^ 11 | .. code:: cuda 12 | 13 | // cp.async.bulk.wait_group N; // PTX ISA 80, SM_90 14 | template 15 | __device__ static inline void cp_async_bulk_wait_group( 16 | cuda::ptx::n32_t N); 17 | 18 | cp.async.bulk.wait_group.read 19 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 20 | .. code:: cuda 21 | 22 | // cp.async.bulk.wait_group.read N; // PTX ISA 80, SM_90 23 | template 24 | __device__ static inline void cp_async_bulk_wait_group_read( 25 | cuda::ptx::n32_t N); 26 | -------------------------------------------------------------------------------- /.upstream-tests/test/cuda/chrono/to_time_t.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // 11 | 12 | // system_clock 13 | 14 | // time_t to_time_t(const time_point& t); 15 | 16 | #include 17 | 18 | #include "test_macros.h" 19 | #include 20 | 21 | int main(int, char**) 22 | { 23 | NV_IF_TARGET(NV_IS_HOST, 24 | (typedef ::std::chrono::system_clock C; cuda::std::time_t t1 = C::to_time_t(C::now()); unused(t1);)); 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/memory/specialized.algorithms/specialized.addressof/addressof.temp.compile.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // UNSUPPORTED: c++11 11 | 12 | // 13 | 14 | // template T* addressof(T&& r) = delete; 15 | 16 | #include 17 | #include 18 | 19 | #include "test_macros.h" 20 | 21 | int main(int, char**) 22 | { 23 | const int* p = cuda::std::addressof(0); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.cal/time.cal.wdlast/types.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // UNSUPPORTED: c++98, c++03, c++11 9 | 10 | // 11 | // class weekday_last; 12 | 13 | #include 14 | #include 15 | 16 | #include "test_macros.h" 17 | 18 | int main(int, char**) 19 | { 20 | using weekday_last = cuda::std::chrono::weekday_last; 21 | 22 | static_assert(cuda::std::is_trivially_copyable_v, ""); 23 | static_assert(cuda::std::is_standard_layout_v, ""); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.duration/default_ratio.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // duration 12 | 13 | // Test default template arg: 14 | 15 | // template > 16 | // class duration; 17 | 18 | #include 19 | #include 20 | 21 | int main(int, char**) 22 | { 23 | static_assert( 24 | (cuda::std::is_same>, cuda::std::chrono::duration>::value), 25 | ""); 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.duration/time.duration.cons/rep02.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // duration 12 | 13 | // template 14 | // explicit duration(const Rep2& r); 15 | 16 | // Rep2 shall be implicitly convertible to rep 17 | 18 | // .fail. expects compilation to fail, but this would only fail at runtime with NVRTC 19 | 20 | #include 21 | 22 | #include "../../rep.h" 23 | 24 | int main(int, char**) 25 | { 26 | cuda::std::chrono::duration d(1); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /.upstream-tests/test/support/disable_missing_braces_warning.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #ifndef SUPPORT_DISABLE_MISSING_BRACES_WARNING_H 9 | #define SUPPORT_DISABLE_MISSING_BRACES_WARNING_H 10 | 11 | // std::array is explicitly allowed to be initialized with A a = { init-list };. 12 | // Disable the missing braces warning for this reason. 13 | #if defined(__GNUC__) 14 | # pragma GCC diagnostic ignored "-Wmissing-braces" 15 | #elif defined(__clang__) 16 | # pragma clang diagnostic ignored "-Wmissing-braces" 17 | #endif 18 | 19 | #endif // SUPPORT_DISABLE_MISSING_BRACES_WARNING_H 20 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.cal/time.cal.mwd/types.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // UNSUPPORTED: c++98, c++03, c++11 9 | 10 | // 11 | // class month_weekday; 12 | 13 | #include 14 | #include 15 | 16 | #include "test_macros.h" 17 | 18 | int main(int, char**) 19 | { 20 | using month_weekday = cuda::std::chrono::month_weekday; 21 | 22 | static_assert(cuda::std::is_trivially_copyable_v, ""); 23 | static_assert(cuda::std::is_standard_layout_v, ""); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/atomics/atomics.flag/copy_ctor.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // 9 | // UNSUPPORTED: pre-sm-60 10 | // UNSUPPORTED: windows && pre-sm-70 11 | 12 | // .fail. expects compilation to fail, but this would only fail at runtime with NVRTC 13 | 14 | // 15 | 16 | // struct atomic_flag 17 | 18 | // atomic_flag(const atomic_flag&) = delete; 19 | 20 | #include 21 | #include 22 | 23 | int main(int, char**) 24 | { 25 | cuda::std::atomic_flag f0; 26 | cuda::std::atomic_flag f(f0); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/utility/as_const/as_const.compile.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // UNSUPPORTED: c++03, c++11 11 | 12 | // template constexpr add_const& as_const(T& t) noexcept; // C++17 13 | // template add_const& as_const(const T&&) = delete; // C++17 14 | 15 | #include 16 | 17 | struct S 18 | { 19 | int i; 20 | }; 21 | 22 | int main(int, char**) 23 | { 24 | cuda::std::as_const(S{}); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/utility/pairs/pair.piecewise/piecewise_construct_t.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // UNSUPPORTED: c++98, c++03 10 | 11 | // 12 | 13 | // struct piecewise_construct_t { explicit piecewise_construct_t() = default; }; 14 | // constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t(); 15 | 16 | #include 17 | 18 | #include "test_macros.h" 19 | 20 | int main(int, char**) 21 | { 22 | cuda::std::piecewise_construct_t x = cuda::std::piecewise_construct; 23 | unused(x); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /._upstream/.upstream-tests/atomic_codegen/atomic_add_non_volatile.cu: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | __global__ void add_relaxed_device_non_volatile(int* data, int* out, int n) 4 | { 5 | auto ref = cuda::atomic_ref{*(data)}; 6 | *out = ref.fetch_add(n, cuda::std::memory_order_relaxed); 7 | } 8 | 9 | /* 10 | 11 | ; SM8X-LABEL: .target sm_80 12 | ; SM8X: .visible .entry [[FUNCTION:_.*add_relaxed_device_non_volatile.*]]( 13 | ; SM8X-DAG: ld.param.u64 %rd[[#ATOM:]], [[[FUNCTION]]_param_0]; 14 | ; SM8X-DAG: ld.param.u64 %rd[[#RESULT:]], [[[FUNCTION]]_param_1]; 15 | ; SM8X-DAG: ld.param.u32 %r[[#INPUT:]], [[[FUNCTION]]_param_2]; 16 | ; SM8X-NEXT: cvta.to.global.u64 %rd[[#GOUT:]], %rd[[#RESULT]]; 17 | ; SM8X-NEXT: // 18 | ; SM8X-NEXT: atom.add.relaxed.gpu.s32 %r[[#DEST:]],[%rd[[#ATOM]]],%r[[#INPUT]]; 19 | ; SM8X-NEXT: // 20 | ; SM8X-NEXT: st.global.u32 [%rd[[#GOUT]]], %r[[#DEST]]; 21 | ; SM8X-NEXT: ret; 22 | 23 | */ 24 | -------------------------------------------------------------------------------- /.upstream-tests/test/cuda/chrono/from_time_t.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // 11 | 12 | // system_clock 13 | 14 | // static time_point from_time_t(time_t t); 15 | 16 | #include 17 | 18 | #include "test_macros.h" 19 | #include 20 | 21 | int main(int, char**) 22 | { 23 | NV_IF_TARGET( 24 | NV_IS_HOST, 25 | (typedef ::std::chrono::system_clock C; C::time_point t1 = C::from_time_t(C::to_time_t(C::now())); unused(t1);)); 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.cal/time.cal.wdidx/types.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // UNSUPPORTED: c++98, c++03, c++11 9 | 10 | // 11 | // class weekday_indexed; 12 | 13 | #include 14 | #include 15 | 16 | #include "test_macros.h" 17 | 18 | int main(int, char**) 19 | { 20 | using weekday_indexed = cuda::std::chrono::weekday_indexed; 21 | 22 | static_assert(cuda::std::is_trivially_copyable_v, ""); 23 | static_assert(cuda::std::is_standard_layout_v, ""); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /.upstream-tests/test/internal_headers/header_test.cpp.in: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of libcu++, the C++ Standard Library for your entire system, 4 | // under the Apache License v2.0 with LLVM Exceptions. 5 | // See https://llvm.org/LICENSE.txt for license information. 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 8 | // 9 | //===----------------------------------------------------------------------===// 10 | 11 | #if defined(_MSC_VER) 12 | # define NOMINMAX 13 | #endif 14 | 15 | // We need to include at least some header so that __cuda_std__ is defined 16 | #include 17 | 18 | // ignore deprecation warnings 19 | _CCCL_SUPPRESS_DEPRECATED_PUSH 20 | 21 | // This file tests that the respective header is includable on its own with a cuda compiler 22 | #include 23 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/stream.iterators/iterator.range/begin_array.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // 11 | 12 | // template T* begin(T (&array)[N]); 13 | 14 | #include 15 | #include 16 | 17 | #include "test_macros.h" 18 | 19 | int main(int, char**) 20 | { 21 | int ia[] = {1, 2, 3}; 22 | int* i = cuda::std::begin(ia); 23 | assert(*i == 1); 24 | *i = 2; 25 | assert(ia[0] == 2); 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/function.objects/negators/not2.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | // UNSUPPORTED: c++20 11 | 12 | // not2 13 | 14 | #define _LIBCUDACXX_DISABLE_DEPRECATION_WARNINGS 15 | 16 | #include 17 | #include 18 | 19 | int main(int, char**) 20 | { 21 | typedef cuda::std::logical_and F; 22 | assert(!cuda::std::not2(F())(36, 36)); 23 | assert(cuda::std::not2(F())(36, 0)); 24 | assert(cuda::std::not2(F())(0, 36)); 25 | assert(cuda::std::not2(F())(0, 0)); 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.cal/time.cal.mdlast/types.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // UNSUPPORTED: c++98, c++03, c++11 9 | 10 | // 11 | 12 | // class month_day_last; 13 | 14 | #include 15 | #include 16 | 17 | #include "test_macros.h" 18 | 19 | int main(int, char**) 20 | { 21 | using month_day_last = cuda::std::chrono::month_day_last; 22 | 23 | static_assert(cuda::std::is_trivially_copyable_v, ""); 24 | static_assert(cuda::std::is_standard_layout_v, ""); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.cal/time.cal.ym/types.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // UNSUPPORTED: c++98, c++03, c++11 9 | 10 | // 11 | // class year_month; 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | #include "test_macros.h" 18 | 19 | int main(int, char**) 20 | { 21 | using year_month = cuda::std::chrono::year_month; 22 | 23 | static_assert(cuda::std::is_trivially_copyable_v, ""); 24 | static_assert(cuda::std::is_standard_layout_v, ""); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/utility/pairs/pair.astuple/tuple_element.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // template struct pair 12 | 13 | // tuple_element >::type 14 | 15 | #include 16 | 17 | int main(int, char**) 18 | { 19 | typedef cuda::std::pair T; 20 | cuda::std::tuple_element<2, T>::type foo; // expected-error@__utility/pair.h:* {{Index out of bounds in 21 | // cuda::std::tuple_element>}} 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /include/cuda/atomic: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of libcu++, the C++ Standard Library for your entire system, 4 | // under the Apache License v2.0 with LLVM Exceptions. 5 | // See https://llvm.org/LICENSE.txt for license information. 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 8 | // 9 | //===----------------------------------------------------------------------===// 10 | 11 | #ifndef _CUDA_ATOMIC 12 | #define _CUDA_ATOMIC 13 | 14 | #include 15 | 16 | #if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) 17 | # pragma GCC system_header 18 | #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) 19 | # pragma clang system_header 20 | #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) 21 | # pragma system_header 22 | #endif // no system header 23 | 24 | #endif // _CUDA_ATOMIC 25 | -------------------------------------------------------------------------------- /._upstream/.upstream-tests/atomic_codegen/atomic_exch_non_volatile.cu: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | __global__ void exch_device_relaxed_non_volatile(int* data, int* out, int n) 4 | { 5 | auto ref = cuda::atomic_ref{*(data)}; 6 | *out = ref.exchange(n, cuda::std::memory_order_relaxed); 7 | } 8 | 9 | /* 10 | 11 | ; SM8X-LABEL: .target sm_80 12 | ; SM8X: .visible .entry [[FUNCTION:_.*exch_device_relaxed_non_volatile.*]]( 13 | ; SM8X-DAG: ld.param.u64 %rd[[#ATOM:]], [[[FUNCTION]]_param_0]; 14 | ; SM8X-DAG: ld.param.u64 %rd[[#EXPECTED:]], [[[FUNCTION]]_param_1]; 15 | ; SM8X-DAG: ld.param.u32 %r[[#INPUT:]], [[[FUNCTION]]_param_2]; 16 | ; SM8X-NEXT: cvta.to.global.u64 %rd[[#GOUT:]], %rd[[#EXPECTED]]; 17 | ; SM8X-NEXT: // 18 | ; SM8X-NEXT: atom.exch.relaxed.gpu.b32 %r[[#DEST:]],[%rd[[#ATOM]]],%r[[#INPUT]]; 19 | ; SM8X-NEXT: // 20 | ; SM8X-NEXT: st.global.u32 [%rd[[#GOUT]]], %r[[#DEST]]; 21 | ; SM8X-NEXT: ret; 22 | 23 | */ 24 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/meta/meta.trans/meta.trans.other/enable_if.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // type_traits 10 | 11 | // enable_if 12 | 13 | #include 14 | 15 | #include "test_macros.h" 16 | 17 | int main(int, char**) 18 | { 19 | ASSERT_SAME_TYPE(void, cuda::std::enable_if::type); 20 | ASSERT_SAME_TYPE(int, cuda::std::enable_if::type); 21 | #if TEST_STD_VER > 2011 22 | ASSERT_SAME_TYPE(void, cuda::std::enable_if_t); 23 | ASSERT_SAME_TYPE(int, cuda::std::enable_if_t); 24 | #endif 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.duration/types.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // duration 12 | 13 | // Test nested types 14 | 15 | // typedef Rep rep; 16 | // typedef Period period; 17 | 18 | #include 19 | #include 20 | 21 | int main(int, char**) 22 | { 23 | typedef cuda::std::chrono::duration> D; 24 | static_assert((cuda::std::is_same::value), ""); 25 | static_assert((cuda::std::is_same>::value), ""); 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/atomics/atomics.flag/copy_assign.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // 9 | // UNSUPPORTED: pre-sm-60 10 | // UNSUPPORTED: windows && pre-sm-70 11 | 12 | // .fail. expects compilation to fail, but this would only fail at runtime with NVRTC 13 | 14 | // 15 | 16 | // struct atomic_flag 17 | 18 | // atomic_flag& operator=(const atomic_flag&) = delete; 19 | 20 | #include 21 | #include 22 | 23 | int main(int, char**) 24 | { 25 | cuda::std::atomic_flag f0; 26 | cuda::std::atomic_flag f; 27 | f = f0; 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/language.support/support.types/byteops/enum_direct_init.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #include 10 | 11 | #include 12 | 13 | // UNSUPPORTED: c++98, c++03, c++11, c++14 14 | // The following compilers don't like "cuda::std::byte b1{1}" 15 | // XFAIL: clang-3.5, clang-3.6, clang-3.7, clang-3.8 16 | // XFAIL: apple-clang-6, apple-clang-7, apple-clang-8.0 17 | // UNSUPPORTED: gcc-6 18 | 19 | int main(int, char**) 20 | { 21 | constexpr cuda::std::byte b{42}; 22 | static_assert(cuda::std::to_integer(b) == 42, ""); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.cal/time.cal.mwdlast/types.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // UNSUPPORTED: c++98, c++03, c++11 9 | 10 | // 11 | 12 | // class month_weekday_last; 13 | 14 | #include 15 | #include 16 | 17 | #include "test_macros.h" 18 | 19 | int main(int, char**) 20 | { 21 | using month_weekday_last = cuda::std::chrono::month_weekday_last; 22 | 23 | static_assert(cuda::std::is_trivially_copyable_v, ""); 24 | static_assert(cuda::std::is_standard_layout_v, ""); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.cal/time.cal.ymd/types.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // UNSUPPORTED: c++98, c++03, c++11 9 | 10 | // 11 | // class year_month_day; 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | #include "test_macros.h" 18 | 19 | int main(int, char**) 20 | { 21 | using year_month_day = cuda::std::chrono::year_month_day; 22 | 23 | static_assert(cuda::std::is_trivially_copyable_v, ""); 24 | static_assert(cuda::std::is_standard_layout_v, ""); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /.upstream-tests/test/cuda/proclaim_return_type.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of libcu++, the C++ Standard Library for your entire system, 4 | // under the Apache License v2.0 with LLVM Exceptions. 5 | // See https://llvm.org/LICENSE.txt for license information. 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 8 | // 9 | //===----------------------------------------------------------------------===// 10 | 11 | // UNSUPPORTED: c++98, c++03 12 | 13 | #include 14 | 15 | #include 16 | 17 | int main(int argc, char** argv) 18 | { 19 | NV_IF_ELSE_TARGET( 20 | NV_IS_DEVICE, 21 | (auto f = cuda::proclaim_return_type([] __device__() -> int { 22 | return 42; 23 | }); 24 | 25 | assert(f() == 42);), 26 | static_assert(false);) 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/stream.iterators/iterator.range/end_array.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // 11 | 12 | // template T* end(T (&array)[N]); 13 | 14 | #include 15 | #include 16 | 17 | #include "test_macros.h" 18 | 19 | int main(int, char**) 20 | { 21 | int ia[] = {1, 2, 3}; 22 | int* i = cuda::std::begin(ia); 23 | int* e = cuda::std::end(ia); 24 | assert(e == ia + 3); 25 | assert(e - i == 3); 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/atomics/atomics.flag/copy_volatile_assign.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // 9 | // UNSUPPORTED: pre-sm-60 10 | // UNSUPPORTED: windows && pre-sm-70 11 | 12 | // .fail. expects compilation to fail, but this would only fail at runtime with NVRTC 13 | 14 | // 15 | 16 | // struct atomic_flag 17 | 18 | // atomic_flag& operator=(const atomic_flag&) = delete; 19 | 20 | #include 21 | #include 22 | 23 | int main(int, char**) 24 | { 25 | cuda::std::atomic_flag f0; 26 | volatile cuda::std::atomic_flag f; 27 | f = f0; 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.point/time.point.cons/duration.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // time_point 12 | 13 | // explicit time_point(const duration& d); 14 | 15 | // test for explicit 16 | 17 | // .fail. expects compilation to fail, but this would only fail at runtime with NVRTC 18 | 19 | #include 20 | 21 | int main(int, char**) 22 | { 23 | typedef cuda::std::chrono::system_clock Clock; 24 | typedef cuda::std::chrono::milliseconds Duration; 25 | cuda::std::chrono::time_point t = Duration(3); 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /.upstream-tests/utils/amd/hiprtc/utils/platform.win.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define WIN32_LEAN_AND_MEAN 4 | #include 5 | 6 | #include 7 | 8 | static void platform_exec(char const* process, char** args, size_t nargs) 9 | { 10 | std::string cl{}; 11 | 12 | STARTUPINFOA si{}; 13 | PROCESS_INFORMATION pi{}; 14 | 15 | si.cb = sizeof(si); 16 | 17 | cl.append(process); 18 | 19 | for (auto iter = args; iter < (args + nargs); iter++) 20 | { 21 | cl.append(" "); 22 | cl.append(*iter); 23 | } 24 | 25 | printf("Running command: %s\r\n", cl.data()); 26 | 27 | bool exec_result = 28 | CreateProcess(nullptr, (LPSTR) cl.data(), nullptr, nullptr, false, false, nullptr, nullptr, &si, &pi); 29 | 30 | if (!exec_result) 31 | { 32 | printf("Launch error: %i", GetLastError()); 33 | } 34 | 35 | WaitForSingleObject(pi.hProcess, INFINITE); 36 | 37 | CloseHandle(pi.hProcess); 38 | CloseHandle(pi.hThread); 39 | 40 | ExitProcess(0); 41 | } 42 | -------------------------------------------------------------------------------- /.upstream-tests/utils/nvidia/nvrtc/utils/platform.win.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define WIN32_LEAN_AND_MEAN 4 | #include 5 | 6 | #include 7 | 8 | static void platform_exec(char const* process, char** args, size_t nargs) 9 | { 10 | std::string cl{}; 11 | 12 | STARTUPINFOA si{}; 13 | PROCESS_INFORMATION pi{}; 14 | 15 | si.cb = sizeof(si); 16 | 17 | cl.append(process); 18 | 19 | for (auto iter = args; iter < (args + nargs); iter++) 20 | { 21 | cl.append(" "); 22 | cl.append(*iter); 23 | } 24 | 25 | printf("Running command: %s\r\n", cl.data()); 26 | 27 | bool exec_result = 28 | CreateProcess(nullptr, (LPSTR) cl.data(), nullptr, nullptr, false, false, nullptr, nullptr, &si, &pi); 29 | 30 | if (!exec_result) 31 | { 32 | printf("Launch error: %i", GetLastError()); 33 | } 34 | 35 | WaitForSingleObject(pi.hProcess, INFINITE); 36 | 37 | CloseHandle(pi.hProcess); 38 | CloseHandle(pi.hThread); 39 | 40 | ExitProcess(0); 41 | } 42 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/default.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // 11 | 12 | // class istream_iterator 13 | 14 | // constexpr istream_iterator(); 15 | 16 | #include 17 | #include 18 | 19 | #include "test_macros.h" 20 | 21 | struct S 22 | { 23 | S(); 24 | }; // not constexpr 25 | 26 | int main(int, char**) 27 | { 28 | { 29 | constexpr cuda::std::istream_iterator it; 30 | } 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.duration/time.duration.cons/convert_inexact.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // duration 12 | 13 | // template 14 | // duration(const duration& d); 15 | 16 | // inexact conversions disallowed for integral reps 17 | 18 | // .fail. expects compilation to fail, but this would only fail at runtime with NVRTC 19 | 20 | #include 21 | 22 | int main(int, char**) 23 | { 24 | cuda::std::chrono::microseconds us(1); 25 | cuda::std::chrono::milliseconds ms = us; 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.duration/time.duration.cons/rep02.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // duration 12 | 13 | // template 14 | // explicit duration(const Rep2& r); 15 | 16 | // construct double with int 17 | 18 | #include 19 | #include 20 | 21 | #include "test_macros.h" 22 | 23 | int main(int, char**) 24 | { 25 | cuda::std::chrono::duration d(5); 26 | assert(d.count() == 5); 27 | constexpr cuda::std::chrono::duration d2(5); 28 | static_assert(d2.count() == 5, ""); 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/language.support/support.types/byteops/to_integer.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #include 10 | 11 | #include 12 | 13 | // UNSUPPORTED: c++98, c++03, c++11, c++14 14 | 15 | // template 16 | // constexpr IntegerType to_integer(byte b) noexcept; 17 | // This function shall not participate in overload resolution unless 18 | // is_integral_v is true. 19 | 20 | int main(int, char**) 21 | { 22 | constexpr cuda::std::byte b1{static_cast(1)}; 23 | auto f = cuda::std::to_integer(b1); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /._upstream/.upstream-tests/atomic_codegen/atomic_sub_non_volatile.cu: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | __global__ void sub_relaxed_device_non_volatile(int* data, int* out, int n) 4 | { 5 | auto ref = cuda::atomic_ref{*(data)}; 6 | *out = ref.fetch_sub(n, cuda::std::memory_order_relaxed); 7 | } 8 | 9 | /* 10 | 11 | ; SM8X-LABEL: .target sm_80 12 | ; SM8X: .visible .entry [[FUNCTION:_.*sub_relaxed_device_non_volatile.*]]( 13 | ; SM8X-DAG: ld.param.u64 %rd[[#ATOM:]], [[[FUNCTION]]_param_0]; 14 | ; SM8X-DAG: ld.param.u64 %rd[[#RESULT:]], [[[FUNCTION]]_param_1]; 15 | ; SM8X-DAG: ld.param.u32 %r[[#INPUT:]], [[[FUNCTION]]_param_2]; 16 | ; SM8X-NEXT: cvta.to.global.u64 %rd[[#GOUT:]], %rd[[#RESULT]]; 17 | ; SM8X-NEXT: neg.s32 %r[[#NEG:]], %r[[#INPUT]]; 18 | ; SM8X-NEXT: // 19 | ; SM8X-NEXT: atom.add.relaxed.gpu.s32 %r[[#DEST:]],[%rd[[#ATOM]]],%r[[#NEG]]; 20 | ; SM8X-NEXT: // 21 | ; SM8X-NEXT: st.global.u32 [%rd[[#GOUT]]], %r[[#DEST]]; 22 | ; SM8X-NEXT: ret; 23 | 24 | */ 25 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_var_init.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // 9 | // UNSUPPORTED: libcpp-has-no-threads, pre-sm-60 10 | // UNSUPPORTED: windows && pre-sm-70 11 | // XFAIL: c++98, c++03 12 | 13 | // 14 | 15 | // #define LIBCUDACXX_ATOMIC_VAR_INIT(value) 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | #include "test_macros.h" 22 | 23 | int main(int, char**) 24 | { 25 | cuda::std::atomic v = LIBCUDACXX_ATOMIC_VAR_INIT(5); 26 | assert(v == 5); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/language.support/support.exception/exception.terminate/set.terminate/set_terminate.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // UNSUPPORTED: true 11 | 12 | // test set_terminate 13 | 14 | #include 15 | #include 16 | 17 | #include "test_macros.h" 18 | 19 | __host__ __device__ void f1() {} 20 | __host__ __device__ void f2() {} 21 | 22 | int main(int, char**) 23 | { 24 | cuda::std::set_terminate(f1); 25 | assert(cuda::std::set_terminate(f2) == f1); 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.cal/time.cal.ymwd/types.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // UNSUPPORTED: c++98, c++03, c++11 9 | 10 | // 11 | // class year_month_weekday; 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | #include "test_macros.h" 18 | 19 | int main(int, char**) 20 | { 21 | using year_month_weekday = cuda::std::chrono::year_month_weekday; 22 | 23 | static_assert(cuda::std::is_trivially_copyable_v, ""); 24 | static_assert(cuda::std::is_standard_layout_v, ""); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.duration/ratio.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // duration 12 | 13 | // Period shall be a specialization of ratio, diagnostic required. 14 | 15 | // .fail. expects compilation to fail, but this would only fail at runtime with NVRTC 16 | 17 | #include 18 | 19 | template 20 | class Ratio 21 | { 22 | public: 23 | static const int num = N; 24 | static const int den = D; 25 | }; 26 | 27 | int main(int, char**) 28 | { 29 | typedef cuda::std::chrono::duration> D; 30 | D d; 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/utility/pairs/pairs.pair/types.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // template 12 | // struct pair 13 | // { 14 | // typedef T1 first_type; 15 | // typedef T2 second_type; 16 | 17 | #include 18 | #include 19 | 20 | #include "test_macros.h" 21 | 22 | int main(int, char**) 23 | { 24 | typedef cuda::std::pair P; 25 | static_assert((cuda::std::is_same::value), ""); 26 | static_assert((cuda::std::is_same::value), ""); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/language.support/support.types/byteops/lshift.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #include 10 | 11 | #include 12 | 13 | // UNSUPPORTED: c++98, c++03, c++11, c++14 14 | 15 | // template 16 | // constexpr byte operator <<(byte b, IntegerType shift) noexcept; 17 | // These functions shall not participate in overload resolution unless 18 | // is_integral_v is true. 19 | 20 | int main(int, char**) 21 | { 22 | constexpr cuda::std::byte b1{static_cast(1)}; 23 | constexpr cuda::std::byte b2 = b1 << 2.0f; 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/language.support/support.types/byteops/rshift.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #include 10 | 11 | #include 12 | 13 | // UNSUPPORTED: c++98, c++03, c++11, c++14 14 | 15 | // template 16 | // constexpr byte operator >>(byte b, IntegerType shift) noexcept; 17 | // These functions shall not participate in overload resolution unless 18 | // is_integral_v is true. 19 | 20 | int main(int, char**) 21 | { 22 | constexpr cuda::std::byte b1{static_cast(1)}; 23 | constexpr cuda::std::byte b2 = b1 >> 2.0f; 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/memory/allocator.tag/allocator_arg.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of libcu++, the C++ Standard Library for your entire system, 4 | // under the Apache License v2.0 with LLVM Exceptions. 5 | // See https://llvm.org/LICENSE.txt for license information. 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 | // SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. 8 | // 9 | //===----------------------------------------------------------------------===// 10 | 11 | // 12 | 13 | // struct allocator_arg_t { explicit allocator_arg_t() = default; }; 14 | // const allocator_arg_t allocator_arg = allocator_arg_t(); 15 | 16 | #include 17 | 18 | #include "test_macros.h" 19 | 20 | __host__ __device__ void test(cuda::std::allocator_arg_t) {} 21 | 22 | int main(int, char**) 23 | { 24 | test(cuda::std::allocator_arg); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/meta/meta.trans/meta.trans.other/conditional.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // type_traits 10 | 11 | // conditional 12 | 13 | #include 14 | 15 | #include "test_macros.h" 16 | 17 | int main(int, char**) 18 | { 19 | ASSERT_SAME_TYPE(char, cuda::std::conditional::type); 20 | ASSERT_SAME_TYPE(int, cuda::std::conditional::type); 21 | #if TEST_STD_VER > 2011 22 | ASSERT_SAME_TYPE(char, cuda::std::conditional_t); 23 | ASSERT_SAME_TYPE(int, cuda::std::conditional_t); 24 | #endif 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /include/cuda/std/variant: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of libcu++, the C++ Standard Library for your entire system, 4 | // under the Apache License v2.0 with LLVM Exceptions. 5 | // See https://llvm.org/LICENSE.txt for license information. 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | #ifndef _CUDA_STD_VARIANT 11 | #define _CUDA_STD_VARIANT 12 | 13 | #include 14 | 15 | #if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) 16 | # pragma GCC system_header 17 | #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) 18 | # pragma clang system_header 19 | #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) 20 | # pragma system_header 21 | #endif // no system header 22 | 23 | _CCCL_PUSH_MACROS 24 | 25 | #include 26 | 27 | _CCCL_POP_MACROS 28 | 29 | #endif //_CUDA_STD_VARIANT 30 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.duration/time.duration.cast/toduration.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // duration 12 | 13 | // template 14 | // ToDuration 15 | // duration_cast(const duration& d); 16 | 17 | // ToDuration shall be an instantiation of duration. 18 | 19 | // .fail. expects compilation to fail, but this would only fail at runtime with NVRTC 20 | 21 | #include 22 | 23 | int main(int, char**) 24 | { 25 | cuda::std::chrono::duration_cast(cuda::std::chrono::milliseconds(3)); 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.duration/time.duration.cons/convert_float_to_int.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // duration 12 | 13 | // template 14 | // duration(const duration& d); 15 | 16 | // conversions from floating point to integral durations disallowed 17 | 18 | // .fail. expects compilation to fail, but this would only fail at runtime with NVRTC 19 | 20 | #include 21 | 22 | int main(int, char**) 23 | { 24 | cuda::std::chrono::duration d; 25 | cuda::std::chrono::duration i = d; 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.duration/time.duration.cast/ceil.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // UNSUPPORTED: c++03, c++11 10 | // 11 | 12 | // ceil 13 | 14 | // template 15 | // ToDuration 16 | // ceil(const duration& d); 17 | 18 | // ToDuration shall be an instantiation of duration. 19 | 20 | // .fail. expects compilation to fail, but this would only fail at runtime with NVRTC 21 | 22 | #include 23 | 24 | int main(int, char**) 25 | { 26 | cuda::std::chrono::ceil(cuda::std::chrono::milliseconds(3)); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.duration/time.duration.cast/floor.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // UNSUPPORTED: c++03, c++11 10 | // 11 | 12 | // floor 13 | 14 | // template 15 | // ToDuration 16 | // floor(const duration& d); 17 | 18 | // ToDuration shall be an instantiation of duration. 19 | 20 | // .fail. expects compilation to fail, but this would only fail at runtime with NVRTC 21 | 22 | #include 23 | 24 | int main(int, char**) 25 | { 26 | cuda::std::chrono::floor(cuda::std::chrono::milliseconds(3)); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.duration/time.duration.cast/round.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // UNSUPPORTED: c++03, c++11 10 | // 11 | 12 | // round 13 | 14 | // template 15 | // ToDuration 16 | // round(const duration& d); 17 | 18 | // ToDuration shall be an instantiation of duration. 19 | 20 | // .fail. expects compilation to fail, but this would only fail at runtime with NVRTC 21 | 22 | #include 23 | 24 | int main(int, char**) 25 | { 26 | cuda::std::chrono::round(cuda::std::chrono::milliseconds(3)); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/containers/views/mdspan/mdspan.accessor.default.members/access.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // UNSUPPORTED: c++11 11 | // UNSUPPORTED: msvc && c++14, msvc && c++17 12 | 13 | #include 14 | #include 15 | 16 | int main(int, char**) 17 | { 18 | { 19 | using element_t = int; 20 | cuda::std::array d{42, 43}; 21 | cuda::std::default_accessor a; 22 | 23 | assert(a.access(d.data(), 0) == 42); 24 | assert(a.access(d.data(), 1) == 43); 25 | } 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/iterator.primitives/std.iterator.tags/input_iterator_tag.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // 11 | 12 | // struct input_iterator_tag {}; 13 | 14 | #include 15 | #include 16 | 17 | #include "test_macros.h" 18 | 19 | int main(int, char**) 20 | { 21 | cuda::std::input_iterator_tag tag; 22 | ((void) tag); // Prevent unused warning 23 | static_assert((!cuda::std::is_base_of::value), ""); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.fail.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | // 10 | 11 | // duration 12 | 13 | // template 14 | // duration::type, Period> 15 | // operator%(const duration& d, const Rep2& s) 16 | 17 | // .fail. expects compilation to fail, but this would only fail at runtime with NVRTC 18 | 19 | #include 20 | 21 | #include "../../rep.h" 22 | 23 | int main(int, char**) 24 | { 25 | cuda::std::chrono::duration d(Rep(15)); 26 | d = d % 5; 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/iterators/iterator.primitives/std.iterator.tags/output_iterator_tag.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | // 11 | 12 | // struct output_iterator_tag {}; 13 | 14 | #include 15 | #include 16 | 17 | #include "test_macros.h" 18 | 19 | int main(int, char**) 20 | { 21 | cuda::std::output_iterator_tag tag; 22 | ((void) tag); // Prevent unused warning 23 | static_assert((!cuda::std::is_base_of::value), ""); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /.upstream-tests/test/std/utilities/time/time.cal/time.cal.ymwdlast/types.pass.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | // UNSUPPORTED: c++98, c++03, c++11 9 | 10 | // 11 | // class year_month_weekday_last_last; 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | #include "test_macros.h" 18 | 19 | int main(int, char**) 20 | { 21 | using year_month_weekday_last = cuda::std::chrono::year_month_weekday_last; 22 | 23 | static_assert(cuda::std::is_trivially_copyable_v, ""); 24 | static_assert(cuda::std::is_standard_layout_v, ""); 25 | 26 | return 0; 27 | } 28 | --------------------------------------------------------------------------------