mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-31 07:40:11 +01:00
This patch does a couple of things to make CL integration with drivers as seamless as possible: - We pull in opencl-c.h and opencl-c-base.h to stop relying on system headers. - Parts of libcl.h are moved to new headers that are incomplete CL-safe variants of libc headers. - A couple of util headers are changed to remove now unnecessary __OPENCL_VERSION__ guards and make more headers CL safe. - Drivers now include src/compiler/libcl and use headers like macros.h,u_math.h instead of libcl.h. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33576>
19 lines
583 B
C
19 lines
583 B
C
/*
|
|
* Copyright 2024 Valve Corporation
|
|
* Copyright 2023 Alyssa Rosenzweig
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#ifndef __OPENCL_VERSION__
|
|
#error "should only be included from OpenCL"
|
|
#endif
|
|
|
|
/* OpenCL C lacks a standard memcpy, but clang has one that will be plumbed into
|
|
* a NIR memcpy intrinsic. This is not a competent implementation of memcpy for
|
|
* large amounts of data, since it's necessarily single threaded, but memcpy is
|
|
* too useful for shared CPU/GPU code that it's worth making the standard
|
|
* library function work.
|
|
*/
|
|
#define memcpy __builtin_memcpy
|