Skip to content

Commit

Permalink
Merge branch 'main' into inbelic/spirv-audit-result
Browse files Browse the repository at this point in the history
  • Loading branch information
inbelic authored Nov 6, 2024
2 parents 7b922d7 + f85be26 commit 4b54fc0
Show file tree
Hide file tree
Showing 119 changed files with 4,047 additions and 828 deletions.
8 changes: 3 additions & 5 deletions clang/include/clang/Serialization/ASTWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -548,20 +548,18 @@ class ASTWriter : public ASTDeserializationListener,
void WriteSubStmt(Stmt *S);

void WriteBlockInfoBlock();
void WriteControlBlock(Preprocessor &PP, ASTContext &Context,
StringRef isysroot);
void WriteControlBlock(Preprocessor &PP, StringRef isysroot);

/// Write out the signature and diagnostic options, and return the signature.
void writeUnhashedControlBlock(Preprocessor &PP, ASTContext &Context);
void writeUnhashedControlBlock(Preprocessor &PP);
ASTFileSignature backpatchSignature();

/// Calculate hash of the pcm content.
std::pair<ASTFileSignature, ASTFileSignature> createSignature() const;
ASTFileSignature createSignatureForNamedModule() const;

void WriteInputFiles(SourceManager &SourceMgr, HeaderSearchOptions &HSOpts);
void WriteSourceManagerBlock(SourceManager &SourceMgr,
const Preprocessor &PP);
void WriteSourceManagerBlock(SourceManager &SourceMgr);
void WritePreprocessor(const Preprocessor &PP, bool IsModule);
void WriteHeaderSearch(const HeaderSearch &HS);
void WritePreprocessorDetail(PreprocessingRecord &PPRec,
Expand Down
52 changes: 24 additions & 28 deletions clang/lib/Serialization/ASTWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1269,8 +1269,7 @@ ASTFileSignature ASTWriter::backpatchSignature() {
return Signature;
}

void ASTWriter::writeUnhashedControlBlock(Preprocessor &PP,
ASTContext &Context) {
void ASTWriter::writeUnhashedControlBlock(Preprocessor &PP) {
using namespace llvm;

// Flush first to prepare the PCM hash (signature).
Expand Down Expand Up @@ -1323,7 +1322,7 @@ void ASTWriter::writeUnhashedControlBlock(Preprocessor &PP,
const auto &HSOpts = PP.getHeaderSearchInfo().getHeaderSearchOpts();

// Diagnostic options.
const auto &Diags = Context.getDiagnostics();
const auto &Diags = PP.getDiagnostics();
const DiagnosticOptions &DiagOpts = Diags.getDiagnosticOptions();
if (!HSOpts.ModulesSkipDiagnosticOptions) {
#define DIAGOPT(Name, Bits, Default) Record.push_back(DiagOpts.Name);
Expand Down Expand Up @@ -1403,10 +1402,12 @@ void ASTWriter::writeUnhashedControlBlock(Preprocessor &PP,
}

/// Write the control block.
void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context,
StringRef isysroot) {
void ASTWriter::WriteControlBlock(Preprocessor &PP, StringRef isysroot) {
using namespace llvm;

SourceManager &SourceMgr = PP.getSourceManager();
FileManager &FileMgr = PP.getFileManager();

Stream.EnterSubblock(CONTROL_BLOCK_ID, 5);
RecordData Record;

Expand Down Expand Up @@ -1454,14 +1455,12 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context,
SmallString<128> BaseDir;
if (PP.getHeaderSearchInfo().getHeaderSearchOpts().ModuleFileHomeIsCwd) {
// Use the current working directory as the base path for all inputs.
auto CWD =
Context.getSourceManager().getFileManager().getOptionalDirectoryRef(
".");
auto CWD = FileMgr.getOptionalDirectoryRef(".");
BaseDir.assign(CWD->getName());
} else {
BaseDir.assign(WritingModule->Directory->getName());
}
cleanPathForOutput(Context.getSourceManager().getFileManager(), BaseDir);
cleanPathForOutput(FileMgr, BaseDir);

// If the home of the module is the current working directory, then we
// want to pick up the cwd of the build process loading the module, not
Expand Down Expand Up @@ -1554,7 +1553,7 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context,

// Language options.
Record.clear();
const LangOptions &LangOpts = Context.getLangOpts();
const LangOptions &LangOpts = PP.getLangOpts();
#define LANGOPT(Name, Bits, Default, Description) \
Record.push_back(LangOpts.Name);
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
Expand Down Expand Up @@ -1591,7 +1590,7 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context,

// Target options.
Record.clear();
const TargetInfo &Target = Context.getTargetInfo();
const TargetInfo &Target = PP.getTargetInfo();
const TargetOptions &TargetOpts = Target.getTargetOpts();
AddString(TargetOpts.Triple, Record);
AddString(TargetOpts.CPU, Record);
Expand All @@ -1609,8 +1608,7 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context,

// File system options.
Record.clear();
const FileSystemOptions &FSOpts =
Context.getSourceManager().getFileManager().getFileSystemOpts();
const FileSystemOptions &FSOpts = FileMgr.getFileSystemOpts();
AddString(FSOpts.WorkingDir, Record);
Stream.EmitRecord(FILE_SYSTEM_OPTIONS, Record);

Expand Down Expand Up @@ -1675,8 +1673,8 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context,
Stream.ExitBlock();

// Original file name and file ID
SourceManager &SM = Context.getSourceManager();
if (auto MainFile = SM.getFileEntryRefForID(SM.getMainFileID())) {
if (auto MainFile =
SourceMgr.getFileEntryRefForID(SourceMgr.getMainFileID())) {
auto FileAbbrev = std::make_shared<BitCodeAbbrev>();
FileAbbrev->Add(BitCodeAbbrevOp(ORIGINAL_FILE));
FileAbbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // File ID
Expand All @@ -1685,16 +1683,15 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context,

Record.clear();
Record.push_back(ORIGINAL_FILE);
AddFileID(SM.getMainFileID(), Record);
AddFileID(SourceMgr.getMainFileID(), Record);
EmitRecordWithPath(FileAbbrevCode, Record, MainFile->getName());
}

Record.clear();
AddFileID(SM.getMainFileID(), Record);
AddFileID(SourceMgr.getMainFileID(), Record);
Stream.EmitRecord(ORIGINAL_FILE_ID, Record);

WriteInputFiles(Context.SourceMgr,
PP.getHeaderSearchInfo().getHeaderSearchOpts());
WriteInputFiles(SourceMgr, PP.getHeaderSearchInfo().getHeaderSearchOpts());
Stream.ExitBlock();
}

Expand Down Expand Up @@ -2234,8 +2231,7 @@ static void emitBlob(llvm::BitstreamWriter &Stream, StringRef Blob,
/// entries for files that we actually need. In the common case (no
/// errors), we probably won't have to create file entries for any of
/// the files in the AST.
void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
const Preprocessor &PP) {
void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr) {
RecordData Record;

// Enter the source manager block.
Expand Down Expand Up @@ -2323,8 +2319,8 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
// We add one to the size so that we capture the trailing NULL
// that is required by llvm::MemoryBuffer::getMemBuffer (on
// the reader side).
std::optional<llvm::MemoryBufferRef> Buffer =
Content->getBufferOrNone(PP.getDiagnostics(), PP.getFileManager());
std::optional<llvm::MemoryBufferRef> Buffer = Content->getBufferOrNone(
SourceMgr.getDiagnostics(), SourceMgr.getFileManager());
StringRef Name = Buffer ? Buffer->getBufferIdentifier() : "";
Stream.EmitRecordWithBlob(SLocBufferAbbrv, Record,
StringRef(Name.data(), Name.size() + 1));
Expand All @@ -2334,8 +2330,8 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
if (EmitBlob) {
// Include the implicit terminating null character in the on-disk buffer
// if we're writing it uncompressed.
std::optional<llvm::MemoryBufferRef> Buffer =
Content->getBufferOrNone(PP.getDiagnostics(), PP.getFileManager());
std::optional<llvm::MemoryBufferRef> Buffer = Content->getBufferOrNone(
SourceMgr.getDiagnostics(), SourceMgr.getFileManager());
if (!Buffer)
Buffer = llvm::MemoryBufferRef("<<<INVALID BUFFER>>>", "");
StringRef Blob(Buffer->getBufferStart(), Buffer->getBufferSize() + 1);
Expand Down Expand Up @@ -5371,7 +5367,7 @@ ASTFileSignature ASTWriter::WriteASTCore(Sema &SemaRef, StringRef isysroot,
// SourceLocations or FileIDs depends on it.
computeNonAffectingInputFiles();

writeUnhashedControlBlock(PP, Context);
writeUnhashedControlBlock(PP);

// Don't reuse type ID and Identifier ID from readers for C++ standard named
// modules since we want to support no-transitive-change model for named
Expand Down Expand Up @@ -5433,7 +5429,7 @@ ASTFileSignature ASTWriter::WriteASTCore(Sema &SemaRef, StringRef isysroot,
PrepareWritingSpecialDecls(SemaRef);

// Write the control block
WriteControlBlock(PP, Context, isysroot);
WriteControlBlock(PP, isysroot);

// Write the remaining AST contents.
Stream.FlushToWord();
Expand Down Expand Up @@ -5526,7 +5522,7 @@ ASTFileSignature ASTWriter::WriteASTCore(Sema &SemaRef, StringRef isysroot,
WriteDeclAndTypes(Context);

WriteFileDeclIDsMap();
WriteSourceManagerBlock(Context.getSourceManager(), PP);
WriteSourceManagerBlock(PP.getSourceManager());
WriteComments();
WritePreprocessor(PP, isModule);
WriteHeaderSearch(PP.getHeaderSearchInfo());
Expand Down
13 changes: 8 additions & 5 deletions compiler-rt/cmake/Modules/AddCompilerRT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -680,15 +680,17 @@ macro(add_custom_libcxx name prefix)

ExternalProject_Add(${name}
DEPENDS ${name}-clobber ${LIBCXX_DEPS}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name}
PREFIX ${prefix}
SOURCE_DIR ${LLVM_MAIN_SRC_DIR}/../runtimes
BINARY_DIR ${prefix}
BINARY_DIR ${prefix}/build
CMAKE_ARGS ${CMAKE_PASSTHROUGH_VARIABLES}
${compiler_args}
${verbose}
-DCMAKE_C_FLAGS=${LIBCXX_C_FLAGS}
-DCMAKE_CXX_FLAGS=${LIBCXX_CXX_FLAGS}
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DCMAKE_INSTALL_MESSAGE=LAZY
-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY
-DLLVM_ENABLE_RUNTIMES=libcxx|libcxxabi
-DLIBCXXABI_USE_LLVM_UNWINDER=OFF
Expand All @@ -701,16 +703,17 @@ macro(add_custom_libcxx name prefix)
-DLIBCXX_INCLUDE_BENCHMARKS=OFF
-DLIBCXX_INCLUDE_TESTS=OFF
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON
-DLLVM_INCLUDE_TESTS=OFF
-DLLVM_INCLUDE_DOCS=OFF
${LIBCXX_CMAKE_ARGS}
INSTALL_COMMAND ""
STEP_TARGETS configure build
STEP_TARGETS configure build install
BUILD_ALWAYS 1
USES_TERMINAL_CONFIGURE 1
USES_TERMINAL_BUILD 1
USES_TERMINAL_INSTALL 1
LIST_SEPARATOR |
EXCLUDE_FROM_ALL TRUE
BUILD_BYPRODUCTS "${prefix}/lib/libc++.a" "${prefix}/lib/libc++abi.a"
INSTALL_BYPRODUCTS "${prefix}/lib/libc++.a" "${prefix}/lib/libc++abi.a"
)

if (CMAKE_GENERATOR MATCHES "Make")
Expand Down
6 changes: 3 additions & 3 deletions compiler-rt/lib/fuzzer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ if(OS_NAME MATCHES "Android|Linux|Fuchsia" AND
-DLIBCXX_ABI_NAMESPACE=__Fuzzer
-DLIBCXX_ENABLE_EXCEPTIONS=OFF)
target_compile_options(RTfuzzer.${arch} PRIVATE -isystem ${LIBCXX_${arch}_PREFIX}/include/c++/v1)
add_dependencies(RTfuzzer.${arch} libcxx_fuzzer_${arch}-build)
add_dependencies(RTfuzzer.${arch} libcxx_fuzzer_${arch}-install)
target_compile_options(RTfuzzer_main.${arch} PRIVATE -isystem ${LIBCXX_${arch}_PREFIX}/include/c++/v1)
add_dependencies(RTfuzzer_main.${arch} libcxx_fuzzer_${arch}-build)
add_dependencies(RTfuzzer_main.${arch} libcxx_fuzzer_${arch}-install)
target_compile_options(RTfuzzer_interceptors.${arch} PRIVATE -isystem ${LIBCXX_${arch}_PREFIX}/include/c++/v1)
add_dependencies(RTfuzzer_interceptors.${arch} libcxx_fuzzer_${arch}-build)
add_dependencies(RTfuzzer_interceptors.${arch} libcxx_fuzzer_${arch}-install)
partially_link_libcxx(fuzzer_no_main ${LIBCXX_${arch}_PREFIX} ${arch})
partially_link_libcxx(fuzzer_interceptors ${LIBCXX_${arch}_PREFIX} ${arch})
partially_link_libcxx(fuzzer ${LIBCXX_${arch}_PREFIX} ${arch})
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/fuzzer/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if(COMPILER_RT_DEFAULT_TARGET_ARCH IN_LIST FUZZER_SUPPORTED_ARCH)
COMPILER_RT_LIBCXX_PATH AND
COMPILER_RT_LIBCXXABI_PATH)
file(GLOB libfuzzer_headers ../*.h)
set(LIBFUZZER_TEST_RUNTIME_DEPS libcxx_fuzzer_${arch}-build ${libfuzzer_headers})
set(LIBFUZZER_TEST_RUNTIME_DEPS libcxx_fuzzer_${arch}-install ${libfuzzer_headers})
set(LIBFUZZER_TEST_RUNTIME_CFLAGS -isystem ${LIBCXX_${arch}_PREFIX}/include/c++/v1)
set(LIBFUZZER_TEST_RUNTIME_LINK_FLAGS ${LIBCXX_${arch}_PREFIX}/lib/libc++.a)
endif()
Expand Down
8 changes: 4 additions & 4 deletions compiler-rt/lib/msan/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ macro(msan_compile obj_list source arch kind cflags)
sanitizer_test_compile(
${obj_list} ${source} ${arch}
KIND ${kind}
COMPILE_DEPS ${MSAN_UNITTEST_HEADERS} libcxx_msan_${arch}-build
COMPILE_DEPS ${MSAN_UNITTEST_HEADERS} libcxx_msan_${arch}-install
DEPS msan
CFLAGS -isystem ${MSAN_LIBCXX_DIR}/../include/c++/v1
${MSAN_UNITTEST_INSTRUMENTED_CFLAGS} ${cflags}
Expand Down Expand Up @@ -117,10 +117,10 @@ macro(add_msan_tests_for_arch arch kind cflags)
DEPS ${MSAN_INST_LOADABLE_OBJECTS})

set(MSAN_TEST_OBJECTS ${MSAN_INST_TEST_OBJECTS} ${MSAN_INST_GTEST})
set(MSAN_TEST_DEPS ${MSAN_TEST_OBJECTS} libcxx_msan_${arch}-build
set(MSAN_TEST_DEPS ${MSAN_TEST_OBJECTS} libcxx_msan_${arch}-install
${MSAN_LOADABLE_SO}
"${MSAN_LIBCXX_DIR}/libc++.a" "${MSAN_LIBCXX_DIR}/libc++abi.a")
list(APPEND MSAN_TEST_DEPS msan libcxx_msan_${arch}-build)
"${MSAN_LIBCXX_DIR}/libc++.a" "${MSAN_LIBCXX_DIR}/libc++abi.a")
list(APPEND MSAN_TEST_DEPS msan libcxx_msan_${arch}-install)
get_target_flags_for_arch(${arch} TARGET_LINK_FLAGS)
add_compiler_rt_test(MsanUnitTests "Msan-${arch}${kind}-Test" ${arch}
OBJECTS ${MSAN_TEST_OBJECTS} "${MSAN_LIBCXX_DIR}/libc++.a" "${MSAN_LIBCXX_DIR}/libc++abi.a"
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/tsan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if(COMPILER_RT_LIBCXX_PATH AND
DEPS ${TSAN_RUNTIME_LIBRARIES}
CFLAGS ${TARGET_CFLAGS} -fsanitize=thread
USE_TOOLCHAIN)
list(APPEND libcxx_tsan_deps libcxx_tsan_${arch}-build)
list(APPEND libcxx_tsan_deps libcxx_tsan_${arch}-install)
endforeach()

add_custom_target(libcxx_tsan DEPENDS ${libcxx_tsan_deps})
Expand Down
4 changes: 3 additions & 1 deletion flang/lib/Semantics/check-declarations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,9 @@ void CheckHelper::CheckObjectEntity(
details.cudaDataAttr().value_or(common::CUDADataAttr::Device) !=
common::CUDADataAttr::Device &&
details.cudaDataAttr().value_or(common::CUDADataAttr::Device) !=
common::CUDADataAttr::Managed) {
common::CUDADataAttr::Managed &&
details.cudaDataAttr().value_or(common::CUDADataAttr::Device) !=
common::CUDADataAttr::Shared) {
Warn(common::UsageWarning::CUDAUsage,
"Dummy argument '%s' may not have ATTRIBUTES(%s) in a device subprogram"_warn_en_US,
symbol.name(),
Expand Down
3 changes: 2 additions & 1 deletion flang/test/Semantics/cuf03.cuf
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ module m
real, unified :: um

contains
attributes(device) subroutine devsubr(n,da)
attributes(device) subroutine devsubr(n,da,rs)
integer, intent(in) :: n
real, device :: da(*) ! ok
real, managed :: ma(n) ! ok
!WARNING: Pointer 'dp' may not be associated in a device subprogram
real, device, pointer :: dp
real, constant :: rc ! ok
real, shared :: rs ! ok
!ERROR: Object 'u' with ATTRIBUTES(UNIFIED) must be declared in a host subprogram
real, unified :: u
end subroutine
Expand Down
82 changes: 82 additions & 0 deletions libclc/clc/include/clc/clc_as_type.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#ifndef __CLC_CLC_AS_TYPE_H__
#define __CLC_CLC_AS_TYPE_H__

#define __clc_as_char(x) __builtin_astype(x, char)
#define __clc_as_uchar(x) __builtin_astype(x, uchar)
#define __clc_as_short(x) __builtin_astype(x, short)
#define __clc_as_ushort(x) __builtin_astype(x, ushort)
#define __clc_as_int(x) __builtin_astype(x, int)
#define __clc_as_uint(x) __builtin_astype(x, uint)
#define __clc_as_long(x) __builtin_astype(x, long)
#define __clc_as_ulong(x) __builtin_astype(x, ulong)
#define __clc_as_float(x) __builtin_astype(x, float)

#define __clc_as_char2(x) __builtin_astype(x, char2)
#define __clc_as_uchar2(x) __builtin_astype(x, uchar2)
#define __clc_as_short2(x) __builtin_astype(x, short2)
#define __clc_as_ushort2(x) __builtin_astype(x, ushort2)
#define __clc_as_int2(x) __builtin_astype(x, int2)
#define __clc_as_uint2(x) __builtin_astype(x, uint2)
#define __clc_as_long2(x) __builtin_astype(x, long2)
#define __clc_as_ulong2(x) __builtin_astype(x, ulong2)
#define __clc_as_float2(x) __builtin_astype(x, float2)

#define __clc_as_char3(x) __builtin_astype(x, char3)
#define __clc_as_uchar3(x) __builtin_astype(x, uchar3)
#define __clc_as_short3(x) __builtin_astype(x, short3)
#define __clc_as_ushort3(x) __builtin_astype(x, ushort3)
#define __clc_as_int3(x) __builtin_astype(x, int3)
#define __clc_as_uint3(x) __builtin_astype(x, uint3)
#define __clc_as_long3(x) __builtin_astype(x, long3)
#define __clc_as_ulong3(x) __builtin_astype(x, ulong3)
#define __clc_as_float3(x) __builtin_astype(x, float3)

#define __clc_as_char4(x) __builtin_astype(x, char4)
#define __clc_as_uchar4(x) __builtin_astype(x, uchar4)
#define __clc_as_short4(x) __builtin_astype(x, short4)
#define __clc_as_ushort4(x) __builtin_astype(x, ushort4)
#define __clc_as_int4(x) __builtin_astype(x, int4)
#define __clc_as_uint4(x) __builtin_astype(x, uint4)
#define __clc_as_long4(x) __builtin_astype(x, long4)
#define __clc_as_ulong4(x) __builtin_astype(x, ulong4)
#define __clc_as_float4(x) __builtin_astype(x, float4)

#define __clc_as_char8(x) __builtin_astype(x, char8)
#define __clc_as_uchar8(x) __builtin_astype(x, uchar8)
#define __clc_as_short8(x) __builtin_astype(x, short8)
#define __clc_as_ushort8(x) __builtin_astype(x, ushort8)
#define __clc_as_int8(x) __builtin_astype(x, int8)
#define __clc_as_uint8(x) __builtin_astype(x, uint8)
#define __clc_as_long8(x) __builtin_astype(x, long8)
#define __clc_as_ulong8(x) __builtin_astype(x, ulong8)
#define __clc_as_float8(x) __builtin_astype(x, float8)

#define __clc_as_char16(x) __builtin_astype(x, char16)
#define __clc_as_uchar16(x) __builtin_astype(x, uchar16)
#define __clc_as_short16(x) __builtin_astype(x, short16)
#define __clc_as_ushort16(x) __builtin_astype(x, ushort16)
#define __clc_as_int16(x) __builtin_astype(x, int16)
#define __clc_as_uint16(x) __builtin_astype(x, uint16)
#define __clc_as_long16(x) __builtin_astype(x, long16)
#define __clc_as_ulong16(x) __builtin_astype(x, ulong16)
#define __clc_as_float16(x) __builtin_astype(x, float16)

#ifdef cl_khr_fp64
#define __clc_as_double(x) __builtin_astype(x, double)
#define __clc_as_double2(x) __builtin_astype(x, double2)
#define __clc_as_double3(x) __builtin_astype(x, double3)
#define __clc_as_double4(x) __builtin_astype(x, double4)
#define __clc_as_double8(x) __builtin_astype(x, double8)
#define __clc_as_double16(x) __builtin_astype(x, double16)
#endif

#ifdef cl_khr_fp16
#define __clc_as_half(x) __builtin_astype(x, half)
#define __clc_as_half2(x) __builtin_astype(x, half2)
#define __clc_as_half3(x) __builtin_astype(x, half3)
#define __clc_as_half4(x) __builtin_astype(x, half4)
#define __clc_as_half8(x) __builtin_astype(x, half8)
#define __clc_as_half16(x) __builtin_astype(x, half16)
#endif

#endif // __CLC_CLC_AS_TYPE_H__
Loading

0 comments on commit 4b54fc0

Please sign in to comment.