Skip to content

Commit

Permalink
Move c/include/cccl/*.h files to c/include/cccl/c/*.h (#2428)
Browse files Browse the repository at this point in the history
* Move c/include/cccl/*.h files to c/include/cccl/c/*.h

* Change `#warning` to `#error` (to improve the user experience).

* Add comments to preprocessor conditionals.

Co-authored-by: Michael Schellenberger Costa <[email protected]>

* Add comments to preprocessor conditionals.

Co-authored-by: Michael Schellenberger Costa <[email protected]>

* Add comment to preprocessor conditional.

---------

Co-authored-by: Michael Schellenberger Costa <[email protected]>
Co-authored-by: Allison Piper <[email protected]>
  • Loading branch information
3 people authored Sep 19, 2024
1 parent 5e14128 commit 2fe09c8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
10 changes: 4 additions & 6 deletions c/include/cccl/reduce.h → c/include/cccl/c/reduce.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
#pragma once

#ifndef CCCL_C_EXPERIMENTAL
# warning "C exposure is experimental and subject to change. Define CCCL_C_EXPERIMENTAL to acknowledge this warning."
#else // ^^^ !CCCL_C_EXPERIMENTAL ^^^ / vvv CCCL_C_EXPERIMENTAL vvv
# error "C exposure is experimental and subject to change. Define CCCL_C_EXPERIMENTAL to acknowledge this notice."
#endif // !CCCL_C_EXPERIMENTAL

# include <cuda.h>
#include <cuda.h>

# include <cccl/types.h>
#include <cccl/c/types.h>

struct cccl_device_reduce_build_result_t
{
Expand Down Expand Up @@ -55,5 +55,3 @@ extern "C" CCCL_C_API CUresult cccl_device_reduce(
CUstream stream) noexcept;

extern "C" CCCL_C_API CUresult cccl_device_reduce_cleanup(cccl_device_reduce_build_result_t* bld_ptr);

#endif // CCCL_C_EXPERIMENTAL
16 changes: 7 additions & 9 deletions c/include/cccl/types.h → c/include/cccl/c/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
#pragma once

#ifndef CCCL_C_EXPERIMENTAL
# warning "C exposure is experimental and subject to change. Define CCCL_C_EXPERIMENTAL to acknowledge this warning."
#else // ^^^ !CCCL_C_EXPERIMENTAL ^^^ / vvv CCCL_C_EXPERIMENTAL vvv
# error "C exposure is experimental and subject to change. Define CCCL_C_EXPERIMENTAL to acknowledge this notice."
#endif // !CCCL_C_EXPERIMENTAL

# if defined(_WIN32)
# define CCCL_C_API __declspec(dllexport)
# else
# define CCCL_C_API __attribute__((visibility("default")))
# endif
#if defined(_WIN32)
# define CCCL_C_API __declspec(dllexport)
#else // ^^^ _WIN32 ^^^ / vvv !_WIN32 vvv
# define CCCL_C_API __attribute__((visibility("default")))
#endif // !_WIN32

enum class cccl_type_enum
{
Expand Down Expand Up @@ -81,5 +81,3 @@ struct cccl_iterator_t
cccl_type_info value_type;
void* state;
};

#endif // CCCL_C_EXPERIMENTAL
2 changes: 1 addition & 1 deletion c/src/reduce.cu
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <iostream>
#include <memory>

#include <cccl/reduce.h>
#include <cccl/c/reduce.h>
#include <nvJitLink.h>
#include <nvrtc.h>

Expand Down
2 changes: 1 addition & 1 deletion c/test/c2h.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <vector>

#include <catch2/catch.hpp>
#include <cccl/reduce.h>
#include <cccl/c/reduce.h>
#include <nvrtc.h>

static std::string inspect_sass(const void* cubin, size_t cubin_size)
Expand Down

0 comments on commit 2fe09c8

Please sign in to comment.