[libclc] [libclc] Reorganize OpenCL builtins (PR #140557)

Fraser Cormack via cfe-commits cfe-commits at lists.llvm.org
Mon May 19 08:10:26 PDT 2025


https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/140557

>From 558a4a73466b96bfa89fc6560e79dea85fe9e92e Mon Sep 17 00:00:00 2001
From: Fraser Cormack <fraser at codeplay.com>
Date: Mon, 19 May 2025 15:54:30 +0100
Subject: [PATCH 1/3] [libclc] Reorganize OpenCL builtins

This commits moves all OpenCL builtins under a top-level 'opencl'
directory, akin to how the CLC builtins are organized. This new
structure aims to better convey the separation of the two layers and
that 'CLC' is not a subset of OpenCL or a libclc target.

In doing so this commit moves the location of the 'lib' directory to
match CLC: libclc/generic/lib/ becomes libclc/opencl/lib/generic/. This
allows us to remove some special casing in CMake and ensure a common
directory structure.

It also tries to better communicate that the OpenCL headers are
libclc-specific OpenCL headers and should not be confused with or used
as standard OpenCL headers. It does so by ensuring includes are of the
form <clc/opencl/*>. It might be that we don't specifically need the
libclc OpenCL headers and we simply could use clang's built-in
declarations, but we can revisit that later.
---
 libclc/CMakeLists.txt                         |  53 ++--
 libclc/clspv/lib/SOURCES                      |  73 -----
 libclc/cmake/modules/AddLibclc.cmake          |  11 +-
 libclc/generic/include/clc/clc.h              | 267 ------------------
 libclc/generic/include/clc/common/degrees.inc |   9 -
 libclc/generic/include/clc/common/radians.inc |   9 -
 .../generic/include/clc/integer/add_sat.inc   |   9 -
 .../generic/include/clc/integer/mad_sat.inc   |   9 -
 libclc/generic/include/clc/integer/rotate.inc |   9 -
 .../generic/include/clc/integer/sub_sat.inc   |   9 -
 libclc/generic/include/clc/integer/unary.inc  |   9 -
 .../include/clc/opencl}/as_type.h             |   0
 .../clc/opencl}/async/async_work_group_copy.h |   8 +-
 .../opencl}/async/async_work_group_copy.inc   |   0
 .../async/async_work_group_strided_copy.h     |   8 +-
 .../async/async_work_group_strided_copy.inc   |   0
 .../include/clc/opencl}/async/prefetch.h      |   4 +-
 .../include/clc/opencl}/async/prefetch.inc    |   0
 .../clc/opencl}/async/wait_group_events.h     |   0
 .../include/clc/opencl}/atomic/atom_add.h     |   6 +-
 .../include/clc/opencl}/atomic/atom_and.h     |   6 +-
 .../include/clc/opencl}/atomic/atom_cmpxchg.h |   0
 .../include/clc/opencl}/atomic/atom_dec.h     |   0
 .../clc/opencl}/atomic/atom_decl_int32.inc    |   0
 .../clc/opencl}/atomic/atom_decl_int64.inc    |   0
 .../include/clc/opencl}/atomic/atom_inc.h     |   0
 .../include/clc/opencl}/atomic/atom_max.h     |   6 +-
 .../include/clc/opencl}/atomic/atom_min.h     |   6 +-
 .../include/clc/opencl}/atomic/atom_or.h      |   6 +-
 .../include/clc/opencl}/atomic/atom_sub.h     |   6 +-
 .../include/clc/opencl}/atomic/atom_xchg.h    |   6 +-
 .../include/clc/opencl}/atomic/atom_xor.h     |   6 +-
 .../include/clc/opencl}/atomic/atomic_add.h   |   2 +-
 .../include/clc/opencl}/atomic/atomic_and.h   |   2 +-
 .../clc/opencl}/atomic/atomic_cmpxchg.h       |   0
 .../include/clc/opencl}/atomic/atomic_dec.h   |   0
 .../clc/opencl}/atomic/atomic_decl.inc        |   0
 .../include/clc/opencl}/atomic/atomic_inc.h   |   0
 .../include/clc/opencl}/atomic/atomic_max.h   |   2 +-
 .../include/clc/opencl}/atomic/atomic_min.h   |   2 +-
 .../include/clc/opencl}/atomic/atomic_or.h    |   2 +-
 .../include/clc/opencl}/atomic/atomic_sub.h   |   2 +-
 .../include/clc/opencl}/atomic/atomic_xchg.h  |   2 +-
 .../include/clc/opencl}/atomic/atomic_xor.h   |   2 +-
 libclc/opencl/include/clc/opencl/clc.h        | 267 ++++++++++++++++++
 .../include/clc/opencl}/common/degrees.h      |   6 +-
 .../include/clc/opencl}/common/mix.h          |   2 +-
 .../include/clc/opencl}/common/mix.inc        |   0
 .../include/clc/opencl}/common/radians.h      |   6 +-
 .../include/clc/opencl}/common/sign.h         |   0
 .../include/clc/opencl}/common/smoothstep.h   |   2 +-
 .../include/clc/opencl}/common/smoothstep.inc |   0
 .../include/clc/opencl}/common/step.h         |   2 +-
 .../include/clc/opencl}/common/step.inc       |   0
 .../include/clc/opencl}/convert.h             |   0
 .../explicit_fence/explicit_memory_fence.h    |   0
 .../include/clc/opencl}/geometric/cross.h     |   0
 .../include/clc/opencl}/geometric/distance.h  |   0
 .../include/clc/opencl}/geometric/dot.h       |   0
 .../clc/opencl}/geometric/fast_distance.h     |   0
 .../clc/opencl}/geometric/fast_length.h       |   0
 .../clc/opencl}/geometric/fast_normalize.h    |   0
 .../include/clc/opencl}/geometric/length.h    |   0
 .../include/clc/opencl}/geometric/normalize.h |   0
 .../include/clc/opencl}/image/image.h         |   0
 .../include/clc/opencl}/image/image_defines.h |   0
 .../include/clc/opencl}/integer/abs.h         |   2 +-
 .../include/clc/opencl}/integer/abs.inc       |   0
 .../include/clc/opencl}/integer/abs_diff.h    |   2 +-
 .../include/clc/opencl}/integer/abs_diff.inc  |   0
 .../include/clc/opencl}/integer/add_sat.h     |   6 +-
 .../include/clc/opencl}/integer/clz.h         |   0
 .../include/clc/opencl}/integer/ctz.h         |   0
 .../include/clc/opencl}/integer/hadd.h        |   0
 .../include/clc/opencl}/integer/mad24.h       |   0
 .../include/clc/opencl}/integer/mad_hi.h      |   0
 .../include/clc/opencl}/integer/mad_sat.h     |   6 +-
 .../include/clc/opencl}/integer/mul24.h       |   0
 .../include/clc/opencl}/integer/mul_hi.h      |   0
 .../include/clc/opencl}/integer/popcount.h    |   0
 .../include/clc/opencl}/integer/rhadd.h       |   0
 .../include/clc/opencl}/integer/rotate.h      |   6 +-
 .../include/clc/opencl}/integer/sub_sat.h     |   6 +-
 .../include/clc/opencl}/integer/upsample.h    |   0
 .../include/clc/opencl}/math/acos.h           |   0
 .../include/clc/opencl}/math/acosh.h          |   0
 .../include/clc/opencl}/math/acospi.h         |   0
 .../include/clc/opencl}/math/asin.h           |   0
 .../include/clc/opencl}/math/asinh.h          |   0
 .../include/clc/opencl}/math/asinpi.h         |   0
 .../include/clc/opencl}/math/atan.h           |   0
 .../include/clc/opencl}/math/atan2.h          |   0
 .../include/clc/opencl}/math/atan2pi.h        |   0
 .../include/clc/opencl}/math/atanh.h          |   0
 .../include/clc/opencl}/math/atanpi.h         |   0
 .../include/clc/opencl}/math/cbrt.h           |   0
 .../include/clc/opencl}/math/ceil.h           |   0
 .../include/clc/opencl}/math/copysign.h       |   0
 .../include/clc/opencl}/math/cos.h            |   0
 .../include/clc/opencl}/math/cosh.h           |   0
 .../include/clc/opencl}/math/cospi.h          |   0
 .../include/clc/opencl}/math/erf.h            |   0
 .../include/clc/opencl}/math/erfc.h           |   0
 .../include/clc/opencl}/math/exp.h            |   0
 .../include/clc/opencl}/math/exp10.h          |   0
 .../include/clc/opencl}/math/exp2.h           |   0
 .../include/clc/opencl}/math/expm1.h          |   0
 .../include/clc/opencl}/math/fabs.h           |   0
 .../include/clc/opencl}/math/fdim.h           |   0
 .../include/clc/opencl}/math/floor.h          |   0
 .../include/clc/opencl}/math/fma.h            |   0
 .../include/clc/opencl}/math/fmax.h           |   0
 .../include/clc/opencl}/math/fmin.h           |   0
 .../include/clc/opencl}/math/fmod.h           |   0
 .../include/clc/opencl}/math/fract.h          |   0
 .../include/clc/opencl}/math/frexp.h          |   2 +-
 .../include/clc/opencl}/math/frexp.inc        |   0
 .../include/clc/opencl}/math/half_cos.h       |   0
 .../include/clc/opencl}/math/half_divide.h    |   0
 .../include/clc/opencl}/math/half_exp.h       |   0
 .../include/clc/opencl}/math/half_exp10.h     |   0
 .../include/clc/opencl}/math/half_exp2.h      |   0
 .../include/clc/opencl}/math/half_log.h       |   0
 .../include/clc/opencl}/math/half_log10.h     |   0
 .../include/clc/opencl}/math/half_log2.h      |   0
 .../include/clc/opencl}/math/half_powr.h      |   0
 .../include/clc/opencl}/math/half_recip.h     |   0
 .../include/clc/opencl}/math/half_rsqrt.h     |   0
 .../include/clc/opencl}/math/half_sin.h       |   0
 .../include/clc/opencl}/math/half_sqrt.h      |   0
 .../include/clc/opencl}/math/half_tan.h       |   0
 .../include/clc/opencl}/math/hypot.h          |   0
 .../include/clc/opencl}/math/ilogb.h          |   0
 .../include/clc/opencl}/math/ldexp.h          |   2 +-
 .../include/clc/opencl}/math/ldexp.inc        |   0
 .../include/clc/opencl}/math/lgamma.h         |   0
 .../include/clc/opencl}/math/lgamma_r.h       |   0
 .../include/clc/opencl}/math/log.h            |   0
 .../include/clc/opencl}/math/log10.h          |   0
 .../include/clc/opencl}/math/log1p.h          |   0
 .../include/clc/opencl}/math/log2.h           |   0
 .../include/clc/opencl}/math/logb.h           |   0
 .../include/clc/opencl}/math/mad.h            |   0
 .../include/clc/opencl}/math/maxmag.h         |   0
 .../include/clc/opencl}/math/minmag.h         |   0
 .../include/clc/opencl}/math/modf.h           |   0
 .../include/clc/opencl}/math/nan.h            |   2 +-
 .../include/clc/opencl}/math/nan.inc          |   0
 .../include/clc/opencl}/math/native_cos.h     |   0
 .../include/clc/opencl}/math/native_divide.h  |   0
 .../include/clc/opencl}/math/native_exp.h     |   0
 .../include/clc/opencl}/math/native_exp10.h   |   0
 .../include/clc/opencl}/math/native_exp2.h    |   0
 .../include/clc/opencl}/math/native_log.h     |   0
 .../include/clc/opencl}/math/native_log10.h   |   0
 .../include/clc/opencl}/math/native_log2.h    |   0
 .../include/clc/opencl}/math/native_powr.h    |   0
 .../include/clc/opencl}/math/native_recip.h   |   0
 .../include/clc/opencl}/math/native_rsqrt.h   |   0
 .../include/clc/opencl}/math/native_sin.h     |   0
 .../include/clc/opencl}/math/native_sqrt.h    |   0
 .../include/clc/opencl}/math/native_tan.h     |   0
 .../include/clc/opencl}/math/nextafter.h      |   0
 .../include/clc/opencl}/math/pow.h            |   0
 .../include/clc/opencl}/math/pown.h           |   0
 .../include/clc/opencl}/math/powr.h           |   0
 .../include/clc/opencl}/math/remainder.h      |   0
 .../include/clc/opencl}/math/remquo.h         |   0
 .../include/clc/opencl}/math/rint.h           |   0
 .../include/clc/opencl}/math/rootn.h          |   0
 .../include/clc/opencl}/math/round.h          |   0
 .../include/clc/opencl}/math/rsqrt.h          |   0
 .../include/clc/opencl}/math/sin.h            |   0
 .../include/clc/opencl}/math/sincos.h         |   0
 .../include/clc/opencl}/math/sinh.h           |   0
 .../include/clc/opencl}/math/sinpi.h          |   0
 .../include/clc/opencl}/math/sqrt.h           |   0
 .../include/clc/opencl}/math/tan.h            |   0
 .../include/clc/opencl}/math/tanh.h           |   0
 .../include/clc/opencl}/math/tanpi.h          |   0
 .../include/clc/opencl}/math/tgamma.h         |   0
 .../include/clc/opencl}/math/trunc.h          |   0
 .../include/clc/opencl}/misc/shuffle.h        |   0
 .../include/clc/opencl}/misc/shuffle2.h       |   0
 .../include/clc/opencl}/relational/all.h      |   0
 .../include/clc/opencl}/relational/any.h      |   0
 .../clc/opencl}/relational/bitselect.h        |   4 +-
 .../clc/opencl}/relational/bitselect.inc      |   0
 .../include/clc/opencl}/relational/isequal.h  |   0
 .../include/clc/opencl}/relational/isfinite.h |   0
 .../clc/opencl}/relational/isgreater.h        |   0
 .../clc/opencl}/relational/isgreaterequal.h   |   0
 .../include/clc/opencl}/relational/isinf.h    |   0
 .../include/clc/opencl}/relational/isless.h   |   0
 .../clc/opencl}/relational/islessequal.h      |   0
 .../clc/opencl}/relational/islessgreater.h    |   0
 .../include/clc/opencl}/relational/isnan.h    |   0
 .../include/clc/opencl}/relational/isnormal.h |   0
 .../clc/opencl}/relational/isnotequal.h       |   0
 .../clc/opencl}/relational/isordered.h        |   0
 .../clc/opencl}/relational/isunordered.h      |   0
 .../include/clc/opencl}/relational/select.h   |   0
 .../include/clc/opencl}/relational/signbit.h  |   0
 .../include/clc/opencl}/shared/clamp.h        |   4 +-
 .../include/clc/opencl}/shared/clamp.inc      |   0
 .../include/clc/opencl}/shared/max.h          |   4 +-
 .../include/clc/opencl}/shared/max.inc        |   0
 .../include/clc/opencl}/shared/min.h          |   4 +-
 .../include/clc/opencl}/shared/min.inc        |   0
 .../include/clc/opencl}/shared/vload.h        |   0
 .../include/clc/opencl}/shared/vstore.h       |   0
 .../clc/opencl}/synchronization/barrier.h     |   0
 .../synchronization/cl_mem_fence_flags.h      |   0
 .../clc/opencl}/workitem/get_global_id.h      |   0
 .../clc/opencl}/workitem/get_global_offset.h  |   0
 .../clc/opencl}/workitem/get_global_size.h    |   0
 .../clc/opencl}/workitem/get_group_id.h       |   0
 .../clc/opencl}/workitem/get_local_id.h       |   0
 .../clc/opencl}/workitem/get_local_size.h     |   0
 .../clc/opencl}/workitem/get_num_groups.h     |   0
 .../clc/opencl}/workitem/get_work_dim.h       |   0
 .../lib => opencl/lib/amdgcn-amdhsa}/SOURCES  |   0
 .../workitem/get_global_size.cl               |   2 +-
 .../amdgcn-amdhsa}/workitem/get_local_size.cl |   2 +-
 .../amdgcn-amdhsa}/workitem/get_num_groups.cl |   2 +-
 .../{amdgcn/lib => opencl/lib/amdgcn}/SOURCES |   0
 .../minmax_helpers.ll                         |   0
 .../lib/amdgcn}/mem_fence/fence.cl            |   2 +-
 .../lib/amdgcn}/synchronization/barrier.cl    |   2 +-
 .../lib/amdgcn}/workitem/get_global_offset.cl |   2 +-
 .../lib/amdgcn}/workitem/get_global_size.cl   |   2 +-
 .../lib/amdgcn}/workitem/get_group_id.cl      |   2 +-
 .../lib/amdgcn}/workitem/get_local_id.cl      |   2 +-
 .../lib/amdgcn}/workitem/get_local_size.cl    |   2 +-
 .../lib/amdgcn}/workitem/get_num_groups.cl    |   2 +-
 .../lib/amdgcn}/workitem/get_work_dim.cl      |   2 +-
 libclc/opencl/lib/clspv/SOURCES               |  73 +++++
 .../lib => opencl/lib/clspv}/math/fma.cl      |   2 +-
 .../lib/clspv}/shared/vstore_half.cl          |   2 +-
 .../lib/clspv}/shared/vstore_half.inc         |   0
 .../lib/clspv}/subnormal_config.cl            |   2 +-
 .../lib => opencl/lib/generic}/SOURCES        |   0
 .../generic}/async/async_work_group_copy.cl   |   2 +-
 .../generic}/async/async_work_group_copy.inc  |   0
 .../async/async_work_group_strided_copy.cl    |   2 +-
 .../async/async_work_group_strided_copy.inc   |   0
 .../lib/generic}/async/prefetch.cl            |   2 +-
 .../lib/generic}/async/prefetch.inc           |   0
 .../lib/generic}/async/wait_group_events.cl   |   2 +-
 .../lib/generic}/atomic/atom_add.cl           |   2 +-
 .../lib/generic}/atomic/atom_and.cl           |   2 +-
 .../lib/generic}/atomic/atom_cmpxchg.cl       |   4 +-
 .../lib/generic}/atomic/atom_dec.cl           |   6 +-
 .../lib/generic}/atomic/atom_inc.cl           |   6 +-
 .../lib/generic}/atomic/atom_int32_binary.inc |   2 +-
 .../lib/generic}/atomic/atom_max.cl           |   2 +-
 .../lib/generic}/atomic/atom_min.cl           |   2 +-
 .../lib/generic}/atomic/atom_or.cl            |   2 +-
 .../lib/generic}/atomic/atom_sub.cl           |   2 +-
 .../lib/generic}/atomic/atom_xchg.cl          |   2 +-
 .../lib/generic}/atomic/atom_xor.cl           |   2 +-
 .../lib/generic}/atomic/atomic_add.cl         |   2 +-
 .../lib/generic}/atomic/atomic_and.cl         |   2 +-
 .../lib/generic}/atomic/atomic_cmpxchg.cl     |   2 +-
 .../lib/generic}/atomic/atomic_dec.cl         |   2 +-
 .../lib/generic}/atomic/atomic_inc.cl         |   2 +-
 .../lib/generic}/atomic/atomic_max.cl         |   2 +-
 .../lib/generic}/atomic/atomic_min.cl         |   2 +-
 .../lib/generic}/atomic/atomic_or.cl          |   2 +-
 .../lib/generic}/atomic/atomic_sub.cl         |   2 +-
 .../lib/generic}/atomic/atomic_xchg.cl        |   2 +-
 .../lib/generic}/atomic/atomic_xor.cl         |   2 +-
 .../lib/generic}/common/degrees.cl            |   2 +-
 .../lib => opencl/lib/generic}/common/mix.cl  |   2 +-
 .../lib => opencl/lib/generic}/common/mix.inc |   0
 .../lib/generic}/common/radians.cl            |   2 +-
 .../lib => opencl/lib/generic}/common/sign.cl |   2 +-
 .../lib/generic}/common/smoothstep.cl         |   2 +-
 .../lib => opencl/lib/generic}/common/step.cl |   2 +-
 .../lib/generic}/geometric/cross.cl           |   2 +-
 .../lib/generic}/geometric/distance.cl        |   2 +-
 .../lib/generic}/geometric/dot.cl             |   2 +-
 .../lib/generic}/geometric/fast_distance.cl   |   2 +-
 .../lib/generic}/geometric/fast_length.cl     |   2 +-
 .../lib/generic}/geometric/fast_normalize.cl  |   2 +-
 .../lib/generic}/geometric/fast_normalize.inc |   0
 .../lib/generic}/geometric/length.cl          |   2 +-
 .../lib/generic}/geometric/normalize.cl       |   2 +-
 .../lib => opencl/lib/generic}/integer/abs.cl |   2 +-
 .../lib/generic}/integer/abs.inc              |   0
 .../lib/generic}/integer/abs_diff.cl          |   2 +-
 .../lib/generic}/integer/abs_diff.inc         |   0
 .../lib/generic}/integer/add_sat.cl           |   2 +-
 .../lib => opencl/lib/generic}/integer/clz.cl |   2 +-
 .../lib => opencl/lib/generic}/integer/ctz.cl |   2 +-
 .../lib/generic}/integer/hadd.cl              |   2 +-
 .../lib/generic}/integer/mad24.cl             |   2 +-
 .../lib/generic}/integer/mad_hi.cl            |   2 +-
 .../lib/generic}/integer/mad_sat.cl           |   2 +-
 .../lib/generic}/integer/mul24.cl             |   2 +-
 .../lib/generic}/integer/mul_hi.cl            |   2 +-
 .../lib/generic}/integer/popcount.cl          |   2 +-
 .../lib/generic}/integer/rhadd.cl             |   2 +-
 .../lib/generic}/integer/rotate.cl            |   2 +-
 .../lib/generic}/integer/sub_sat.cl           |   2 +-
 .../lib/generic}/integer/upsample.cl          |   2 +-
 .../lib => opencl/lib/generic}/math/acos.cl   |   2 +-
 .../lib => opencl/lib/generic}/math/acosh.cl  |   2 +-
 .../lib => opencl/lib/generic}/math/acospi.cl |   2 +-
 .../lib => opencl/lib/generic}/math/asin.cl   |   2 +-
 .../lib => opencl/lib/generic}/math/asinh.cl  |   2 +-
 .../lib => opencl/lib/generic}/math/asinpi.cl |   2 +-
 .../lib => opencl/lib/generic}/math/atan.cl   |   2 +-
 .../lib => opencl/lib/generic}/math/atan2.cl  |   2 +-
 .../lib/generic}/math/atan2pi.cl              |   2 +-
 .../lib => opencl/lib/generic}/math/atanh.cl  |   2 +-
 .../lib => opencl/lib/generic}/math/atanpi.cl |   2 +-
 .../lib => opencl/lib/generic}/math/cbrt.cl   |   2 +-
 .../lib => opencl/lib/generic}/math/ceil.cl   |   2 +-
 .../lib/generic}/math/copysign.cl             |   2 +-
 .../lib => opencl/lib/generic}/math/cos.cl    |   2 +-
 .../lib => opencl/lib/generic}/math/cosh.cl   |   2 +-
 .../lib => opencl/lib/generic}/math/cospi.cl  |   2 +-
 .../lib => opencl/lib/generic}/math/erf.cl    |   2 +-
 .../lib => opencl/lib/generic}/math/erfc.cl   |   2 +-
 .../lib => opencl/lib/generic}/math/exp.cl    |   2 +-
 .../lib => opencl/lib/generic}/math/exp10.cl  |   2 +-
 .../lib => opencl/lib/generic}/math/exp2.cl   |   2 +-
 .../lib => opencl/lib/generic}/math/expm1.cl  |   2 +-
 .../lib => opencl/lib/generic}/math/fabs.cl   |   2 +-
 .../lib => opencl/lib/generic}/math/fdim.cl   |   2 +-
 .../lib => opencl/lib/generic}/math/floor.cl  |   2 +-
 .../lib => opencl/lib/generic}/math/fma.cl    |   2 +-
 .../lib => opencl/lib/generic}/math/fmax.cl   |   2 +-
 .../lib => opencl/lib/generic}/math/fmax.inc  |   0
 .../lib => opencl/lib/generic}/math/fmin.cl   |   2 +-
 .../lib => opencl/lib/generic}/math/fmin.inc  |   0
 .../lib => opencl/lib/generic}/math/fmod.cl   |   2 +-
 .../lib => opencl/lib/generic}/math/fract.cl  |   2 +-
 .../lib => opencl/lib/generic}/math/frexp.cl  |   2 +-
 .../lib/generic}/math/half_cos.cl             |   2 +-
 .../lib/generic}/math/half_divide.cl          |   2 +-
 .../lib/generic}/math/half_exp.cl             |   2 +-
 .../lib/generic}/math/half_exp10.cl           |   2 +-
 .../lib/generic}/math/half_exp2.cl            |   2 +-
 .../lib/generic}/math/half_log.cl             |   2 +-
 .../lib/generic}/math/half_log10.cl           |   2 +-
 .../lib/generic}/math/half_log2.cl            |   2 +-
 .../lib/generic}/math/half_powr.cl            |   2 +-
 .../lib/generic}/math/half_recip.cl           |   2 +-
 .../lib/generic}/math/half_rsqrt.cl           |   2 +-
 .../lib/generic}/math/half_sin.cl             |   2 +-
 .../lib/generic}/math/half_sqrt.cl            |   2 +-
 .../lib/generic}/math/half_tan.cl             |   2 +-
 .../lib => opencl/lib/generic}/math/hypot.cl  |   2 +-
 .../lib => opencl/lib/generic}/math/ilogb.cl  |   2 +-
 .../lib => opencl/lib/generic}/math/ldexp.cl  |   2 +-
 .../lib => opencl/lib/generic}/math/ldexp.inc |   0
 .../lib => opencl/lib/generic}/math/lgamma.cl |   2 +-
 .../lib/generic}/math/lgamma_r.cl             |   2 +-
 .../lib => opencl/lib/generic}/math/log.cl    |   2 +-
 .../lib => opencl/lib/generic}/math/log10.cl  |   2 +-
 .../lib => opencl/lib/generic}/math/log1p.cl  |   2 +-
 .../lib => opencl/lib/generic}/math/log2.cl   |   2 +-
 .../lib => opencl/lib/generic}/math/logb.cl   |   2 +-
 .../lib => opencl/lib/generic}/math/mad.cl    |   2 +-
 .../lib => opencl/lib/generic}/math/maxmag.cl |   2 +-
 .../lib => opencl/lib/generic}/math/minmag.cl |   2 +-
 .../lib => opencl/lib/generic}/math/modf.cl   |   2 +-
 .../lib => opencl/lib/generic}/math/nan.cl    |   0
 .../lib => opencl/lib/generic}/math/nan.inc   |   0
 .../lib/generic}/math/native_cos.cl           |   2 +-
 .../lib/generic}/math/native_divide.cl        |   2 +-
 .../lib/generic}/math/native_exp.cl           |   2 +-
 .../lib/generic}/math/native_exp10.cl         |   2 +-
 .../lib/generic}/math/native_exp2.cl          |   2 +-
 .../lib/generic}/math/native_log.cl           |   2 +-
 .../lib/generic}/math/native_log10.cl         |   2 +-
 .../lib/generic}/math/native_log2.cl          |   2 +-
 .../lib/generic}/math/native_powr.cl          |   2 +-
 .../lib/generic}/math/native_recip.cl         |   2 +-
 .../lib/generic}/math/native_rsqrt.cl         |   2 +-
 .../lib/generic}/math/native_sin.cl           |   2 +-
 .../lib/generic}/math/native_sqrt.cl          |   2 +-
 .../lib/generic}/math/native_tan.cl           |   2 +-
 .../lib/generic}/math/nextafter.cl            |   2 +-
 .../lib => opencl/lib/generic}/math/pow.cl    |   2 +-
 .../lib => opencl/lib/generic}/math/pown.cl   |   2 +-
 .../lib => opencl/lib/generic}/math/powr.cl   |   2 +-
 .../lib/generic}/math/remainder.cl            |   2 +-
 .../lib => opencl/lib/generic}/math/remquo.cl |   2 +-
 .../lib/generic}/math/remquo.inc              |   0
 .../lib => opencl/lib/generic}/math/rint.cl   |   2 +-
 .../lib => opencl/lib/generic}/math/rootn.cl  |   2 +-
 .../lib => opencl/lib/generic}/math/round.cl  |   2 +-
 .../lib => opencl/lib/generic}/math/rsqrt.cl  |   2 +-
 .../lib => opencl/lib/generic}/math/sin.cl    |   2 +-
 .../lib => opencl/lib/generic}/math/sincos.cl |   2 +-
 .../lib => opencl/lib/generic}/math/sinh.cl   |   2 +-
 .../lib => opencl/lib/generic}/math/sinpi.cl  |   2 +-
 .../lib => opencl/lib/generic}/math/sqrt.cl   |   2 +-
 .../lib => opencl/lib/generic}/math/tan.cl    |   2 +-
 .../lib => opencl/lib/generic}/math/tanh.cl   |   2 +-
 .../lib => opencl/lib/generic}/math/tanpi.cl  |   2 +-
 .../lib => opencl/lib/generic}/math/tgamma.cl |   2 +-
 .../lib => opencl/lib/generic}/math/trunc.cl  |   2 +-
 .../lib/generic}/misc/shuffle.cl              |   2 +-
 .../lib/generic}/misc/shuffle2.cl             |   2 +-
 .../lib/generic}/relational/all.cl            |   2 +-
 .../lib/generic}/relational/any.cl            |   2 +-
 .../lib/generic}/relational/binary_def.inc    |   0
 .../lib/generic}/relational/bitselect.cl      |   2 +-
 .../lib/generic}/relational/bitselect.inc     |   0
 .../lib/generic}/relational/isequal.cl        |   2 +-
 .../lib/generic}/relational/isfinite.cl       |   2 +-
 .../lib/generic}/relational/isgreater.cl      |   2 +-
 .../lib/generic}/relational/isgreaterequal.cl |   2 +-
 .../lib/generic}/relational/isinf.cl          |   2 +-
 .../lib/generic}/relational/isless.cl         |   2 +-
 .../lib/generic}/relational/islessequal.cl    |   2 +-
 .../lib/generic}/relational/islessgreater.cl  |   2 +-
 .../lib/generic}/relational/isnan.cl          |   2 +-
 .../lib/generic}/relational/isnormal.cl       |   2 +-
 .../lib/generic}/relational/isnotequal.cl     |   2 +-
 .../lib/generic}/relational/isordered.cl      |   2 +-
 .../lib/generic}/relational/isunordered.cl    |   2 +-
 .../lib/generic}/relational/select.cl         |   2 +-
 .../lib/generic}/relational/signbit.cl        |   2 +-
 .../lib/generic}/relational/unary_def.inc     |   0
 .../lib/generic}/shared/clamp.cl              |   2 +-
 .../lib/generic}/shared/clamp.inc             |   0
 .../lib => opencl/lib/generic}/shared/max.cl  |   2 +-
 .../lib => opencl/lib/generic}/shared/max.inc |   0
 .../lib => opencl/lib/generic}/shared/min.cl  |   2 +-
 .../lib => opencl/lib/generic}/shared/min.inc |   0
 .../lib/generic}/shared/vload.cl              |   2 +-
 .../lib/generic}/shared/vload_half.inc        |   0
 .../lib/generic}/shared/vstore.cl             |   2 +-
 .../lib/generic}/shared/vstore_half.inc       |   0
 .../lib/generic}/subnormal_config.cl          |   2 +-
 .../lib/generic}/subnormal_disable.ll         |   0
 .../lib/generic}/subnormal_helper_func.ll     |   0
 .../lib/generic}/subnormal_use_default.ll     |   0
 .../lib/generic}/workitem/get_global_id.cl    |   2 +-
 .../lib/generic}/workitem/get_global_size.cl  |   2 +-
 .../lib => opencl/lib/ptx-nvidiacl}/SOURCES   |   0
 .../lib/ptx-nvidiacl}/mem_fence/fence.cl      |   2 +-
 .../ptx-nvidiacl}/synchronization/barrier.cl  |   2 +-
 .../ptx-nvidiacl}/workitem/get_global_id.cl   |   2 +-
 .../ptx-nvidiacl}/workitem/get_group_id.cl    |   2 +-
 .../ptx-nvidiacl}/workitem/get_local_id.cl    |   2 +-
 .../ptx-nvidiacl}/workitem/get_local_size.cl  |   2 +-
 .../ptx-nvidiacl}/workitem/get_num_groups.cl  |   2 +-
 libclc/{r600/lib => opencl/lib/r600}/SOURCES  |   0
 .../{r600/lib => opencl/lib/r600}/SOURCES_3.9 |   0
 .../r600}/image/get_image_attributes_impl.ll  |   0
 .../image/get_image_channel_data_type.cl      |   2 +-
 .../r600}/image/get_image_channel_order.cl    |   2 +-
 .../lib/r600}/image/get_image_depth.cl        |   2 +-
 .../lib/r600}/image/get_image_dim.cl          |   2 +-
 .../lib/r600}/image/get_image_height.cl       |   2 +-
 .../lib/r600}/image/get_image_width.cl        |   2 +-
 .../lib/r600}/image/read_image_impl.ll        |   0
 .../lib/r600}/image/read_imagef.cl            |   2 +-
 .../lib/r600}/image/read_imagei.cl            |   2 +-
 .../lib/r600}/image/read_imageui.cl           |   2 +-
 .../lib/r600}/image/write_image_impl.ll       |   0
 .../lib/r600}/image/write_imagef.cl           |   2 +-
 .../lib/r600}/image/write_imagei.cl           |   2 +-
 .../lib/r600}/image/write_imageui.cl          |   2 +-
 .../lib/r600}/synchronization/barrier.cl      |   2 +-
 .../lib/r600}/workitem/get_global_offset.cl   |   2 +-
 .../lib/r600}/workitem/get_global_size.cl     |   2 +-
 .../lib/r600}/workitem/get_group_id.cl        |   2 +-
 .../lib/r600}/workitem/get_local_id.cl        |   2 +-
 .../lib/r600}/workitem/get_local_size.cl      |   2 +-
 .../lib/r600}/workitem/get_num_groups.cl      |   2 +-
 .../lib/r600}/workitem/get_work_dim.cl        |   2 +-
 libclc/opencl/lib/spirv/SOURCES               |  73 +++++
 .../lib => opencl/lib/spirv}/math/fma.cl      |   2 +-
 .../lib/spirv}/subnormal_config.cl            |   2 +-
 libclc/spirv/lib/SOURCES                      |  73 -----
 libclc/{generic/lib => utils}/gen_convert.py  |   2 +-
 483 files changed, 759 insertions(+), 804 deletions(-)
 delete mode 100644 libclc/clspv/lib/SOURCES
 delete mode 100644 libclc/generic/include/clc/clc.h
 delete mode 100644 libclc/generic/include/clc/common/degrees.inc
 delete mode 100644 libclc/generic/include/clc/common/radians.inc
 delete mode 100644 libclc/generic/include/clc/integer/add_sat.inc
 delete mode 100644 libclc/generic/include/clc/integer/mad_sat.inc
 delete mode 100644 libclc/generic/include/clc/integer/rotate.inc
 delete mode 100644 libclc/generic/include/clc/integer/sub_sat.inc
 delete mode 100644 libclc/generic/include/clc/integer/unary.inc
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/as_type.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/async/async_work_group_copy.h (74%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/async/async_work_group_copy.inc (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/async/async_work_group_strided_copy.h (72%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/async/async_work_group_strided_copy.inc (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/async/prefetch.h (81%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/async/prefetch.inc (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/async/wait_group_events.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atom_add.h (83%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atom_and.h (84%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atom_cmpxchg.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atom_dec.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atom_decl_int32.inc (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atom_decl_int64.inc (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atom_inc.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atom_max.h (84%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atom_min.h (84%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atom_or.h (84%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atom_sub.h (83%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atom_xchg.h (84%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atom_xor.h (84%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atomic_add.h (89%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atomic_and.h (89%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atomic_cmpxchg.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atomic_dec.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atomic_decl.inc (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atomic_inc.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atomic_max.h (89%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atomic_min.h (89%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atomic_or.h (89%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atomic_sub.h (89%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atomic_xchg.h (92%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/atomic/atomic_xor.h (89%)
 create mode 100644 libclc/opencl/include/clc/opencl/clc.h
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/common/degrees.h (80%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/common/mix.h (89%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/common/mix.inc (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/common/radians.h (80%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/common/sign.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/common/smoothstep.h (88%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/common/smoothstep.inc (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/common/step.h (89%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/common/step.inc (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/convert.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/explicit_fence/explicit_memory_fence.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/geometric/cross.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/geometric/distance.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/geometric/dot.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/geometric/fast_distance.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/geometric/fast_length.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/geometric/fast_normalize.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/geometric/length.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/geometric/normalize.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/image/image.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/image/image_defines.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/integer/abs.h (89%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/integer/abs.inc (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/integer/abs_diff.h (88%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/integer/abs_diff.inc (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/integer/add_sat.h (79%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/integer/clz.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/integer/ctz.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/integer/hadd.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/integer/mad24.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/integer/mad_hi.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/integer/mad_sat.h (79%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/integer/mul24.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/integer/mul_hi.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/integer/popcount.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/integer/rhadd.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/integer/rotate.h (79%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/integer/sub_sat.h (79%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/integer/upsample.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/acos.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/acosh.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/acospi.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/asin.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/asinh.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/asinpi.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/atan.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/atan2.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/atan2pi.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/atanh.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/atanpi.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/cbrt.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/ceil.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/copysign.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/cos.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/cosh.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/cospi.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/erf.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/erfc.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/exp.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/exp10.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/exp2.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/expm1.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/fabs.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/fdim.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/floor.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/fma.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/fmax.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/fmin.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/fmod.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/fract.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/frexp.h (89%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/frexp.inc (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/half_cos.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/half_divide.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/half_exp.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/half_exp10.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/half_exp2.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/half_log.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/half_log10.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/half_log2.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/half_powr.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/half_recip.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/half_rsqrt.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/half_sin.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/half_sqrt.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/half_tan.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/hypot.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/ilogb.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/ldexp.h (89%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/ldexp.inc (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/lgamma.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/lgamma_r.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/log.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/log10.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/log1p.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/log2.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/logb.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/mad.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/maxmag.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/minmag.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/modf.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/nan.h (89%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/nan.inc (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/native_cos.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/native_divide.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/native_exp.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/native_exp10.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/native_exp2.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/native_log.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/native_log10.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/native_log2.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/native_powr.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/native_recip.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/native_rsqrt.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/native_sin.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/native_sqrt.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/native_tan.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/nextafter.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/pow.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/pown.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/powr.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/remainder.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/remquo.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/rint.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/rootn.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/round.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/rsqrt.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/sin.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/sincos.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/sinh.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/sinpi.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/sqrt.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/tan.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/tanh.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/tanpi.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/tgamma.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/math/trunc.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/misc/shuffle.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/misc/shuffle2.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/relational/all.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/relational/any.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/relational/bitselect.h (79%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/relational/bitselect.inc (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/relational/isequal.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/relational/isfinite.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/relational/isgreater.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/relational/isgreaterequal.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/relational/isinf.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/relational/isless.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/relational/islessequal.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/relational/islessgreater.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/relational/isnan.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/relational/isnormal.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/relational/isnotequal.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/relational/isordered.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/relational/isunordered.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/relational/select.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/relational/signbit.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/shared/clamp.h (81%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/shared/clamp.inc (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/shared/max.h (82%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/shared/max.inc (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/shared/min.h (82%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/shared/min.inc (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/shared/vload.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/shared/vstore.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/synchronization/barrier.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/synchronization/cl_mem_fence_flags.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/workitem/get_global_id.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/workitem/get_global_offset.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/workitem/get_global_size.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/workitem/get_group_id.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/workitem/get_local_id.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/workitem/get_local_size.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/workitem/get_num_groups.h (100%)
 rename libclc/{generic/include/clc => opencl/include/clc/opencl}/workitem/get_work_dim.h (100%)
 rename libclc/{amdgcn-amdhsa/lib => opencl/lib/amdgcn-amdhsa}/SOURCES (100%)
 rename libclc/{amdgcn-amdhsa/lib => opencl/lib/amdgcn-amdhsa}/workitem/get_global_size.cl (97%)
 rename libclc/{amdgcn-amdhsa/lib => opencl/lib/amdgcn-amdhsa}/workitem/get_local_size.cl (97%)
 rename libclc/{amdgcn-amdhsa/lib => opencl/lib/amdgcn-amdhsa}/workitem/get_num_groups.cl (95%)
 rename libclc/{amdgcn/lib => opencl/lib/amdgcn}/SOURCES (100%)
 rename libclc/{amdgcn/lib => opencl/lib/amdgcn}/cl_khr_int64_extended_atomics/minmax_helpers.ll (100%)
 rename libclc/{amdgcn/lib => opencl/lib/amdgcn}/mem_fence/fence.cl (98%)
 rename libclc/{amdgcn/lib => opencl/lib/amdgcn}/synchronization/barrier.cl (94%)
 rename libclc/{amdgcn/lib => opencl/lib/amdgcn}/workitem/get_global_offset.cl (96%)
 rename libclc/{amdgcn/lib => opencl/lib/amdgcn}/workitem/get_global_size.cl (95%)
 rename libclc/{amdgcn/lib => opencl/lib/amdgcn}/workitem/get_group_id.cl (95%)
 rename libclc/{amdgcn/lib => opencl/lib/amdgcn}/workitem/get_local_id.cl (95%)
 rename libclc/{amdgcn/lib => opencl/lib/amdgcn}/workitem/get_local_size.cl (96%)
 rename libclc/{amdgcn/lib => opencl/lib/amdgcn}/workitem/get_num_groups.cl (96%)
 rename libclc/{amdgcn/lib => opencl/lib/amdgcn}/workitem/get_work_dim.cl (96%)
 create mode 100644 libclc/opencl/lib/clspv/SOURCES
 rename libclc/{spirv/lib => opencl/lib/clspv}/math/fma.cl (94%)
 rename libclc/{clspv/lib => opencl/lib/clspv}/shared/vstore_half.cl (99%)
 rename libclc/{clspv/lib => opencl/lib/clspv}/shared/vstore_half.inc (100%)
 rename libclc/{clspv/lib => opencl/lib/clspv}/subnormal_config.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/SOURCES (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/async/async_work_group_copy.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/async/async_work_group_copy.inc (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/async/async_work_group_strided_copy.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/async/async_work_group_strided_copy.inc (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/async/prefetch.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/async/prefetch.inc (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/async/wait_group_events.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atom_add.cl (96%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atom_and.cl (96%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atom_cmpxchg.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atom_dec.cl (91%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atom_inc.cl (91%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atom_int32_binary.inc (96%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atom_max.cl (97%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atom_min.cl (97%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atom_or.cl (96%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atom_sub.cl (96%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atom_xchg.cl (96%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atom_xor.cl (96%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atomic_add.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atomic_and.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atomic_cmpxchg.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atomic_dec.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atomic_inc.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atomic_max.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atomic_min.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atomic_or.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atomic_sub.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atomic_xchg.cl (97%)
 rename libclc/{generic/lib => opencl/lib/generic}/atomic/atomic_xor.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/common/degrees.cl (96%)
 rename libclc/{generic/lib => opencl/lib/generic}/common/mix.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/common/mix.inc (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/common/radians.cl (96%)
 rename libclc/{generic/lib => opencl/lib/generic}/common/sign.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/common/smoothstep.cl (99%)
 rename libclc/{generic/lib => opencl/lib/generic}/common/step.cl (97%)
 rename libclc/{generic/lib => opencl/lib/generic}/geometric/cross.cl (97%)
 rename libclc/{generic/lib => opencl/lib/generic}/geometric/distance.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/geometric/dot.cl (98%)
 rename libclc/{generic/lib => opencl/lib/generic}/geometric/fast_distance.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/geometric/fast_length.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/geometric/fast_normalize.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/geometric/fast_normalize.inc (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/geometric/length.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/geometric/normalize.cl (99%)
 rename libclc/{generic/lib => opencl/lib/generic}/integer/abs.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/integer/abs.inc (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/integer/abs_diff.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/integer/abs_diff.inc (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/integer/add_sat.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/integer/clz.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/integer/ctz.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/integer/hadd.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/integer/mad24.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/integer/mad_hi.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/integer/mad_sat.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/integer/mul24.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/integer/mul_hi.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/integer/popcount.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/integer/rhadd.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/integer/rotate.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/integer/sub_sat.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/integer/upsample.cl (98%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/acos.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/acosh.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/acospi.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/asin.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/asinh.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/asinpi.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/atan.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/atan2.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/atan2pi.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/atanh.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/atanpi.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/cbrt.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/ceil.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/copysign.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/cos.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/cosh.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/cospi.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/erf.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/erfc.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/exp.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/exp10.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/exp2.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/expm1.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/fabs.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/fdim.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/floor.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/fma.cl (96%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/fmax.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/fmax.inc (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/fmin.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/fmin.inc (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/fmod.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/fract.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/frexp.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/half_cos.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/half_divide.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/half_exp.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/half_exp10.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/half_exp2.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/half_log.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/half_log10.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/half_log2.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/half_powr.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/half_recip.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/half_rsqrt.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/half_sin.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/half_sqrt.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/half_tan.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/hypot.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/ilogb.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/ldexp.cl (97%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/ldexp.inc (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/lgamma.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/lgamma_r.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/log.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/log10.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/log1p.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/log2.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/logb.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/mad.cl (96%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/maxmag.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/minmag.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/modf.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/nan.cl (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/nan.inc (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/native_cos.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/native_divide.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/native_exp.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/native_exp10.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/native_exp2.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/native_log.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/native_log10.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/native_log2.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/native_powr.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/native_recip.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/native_rsqrt.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/native_sin.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/native_sqrt.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/native_tan.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/nextafter.cl (97%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/pow.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/pown.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/powr.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/remainder.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/remquo.cl (96%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/remquo.inc (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/rint.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/rootn.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/round.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/rsqrt.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/sin.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/sincos.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/sinh.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/sinpi.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/sqrt.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/tan.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/tanh.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/tanpi.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/tgamma.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/math/trunc.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/misc/shuffle.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/misc/shuffle2.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/relational/all.cl (97%)
 rename libclc/{generic/lib => opencl/lib/generic}/relational/any.cl (97%)
 rename libclc/{generic/lib => opencl/lib/generic}/relational/binary_def.inc (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/relational/bitselect.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/relational/bitselect.inc (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/relational/isequal.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/relational/isfinite.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/relational/isgreater.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/relational/isgreaterequal.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/relational/isinf.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/relational/isless.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/relational/islessequal.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/relational/islessgreater.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/relational/isnan.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/relational/isnormal.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/relational/isnotequal.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/relational/isordered.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/relational/isunordered.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/relational/select.cl (96%)
 rename libclc/{generic/lib => opencl/lib/generic}/relational/signbit.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/relational/unary_def.inc (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/shared/clamp.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/shared/clamp.inc (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/shared/max.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/shared/max.inc (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/shared/min.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/shared/min.inc (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/shared/vload.cl (99%)
 rename libclc/{generic/lib => opencl/lib/generic}/shared/vload_half.inc (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/shared/vstore.cl (99%)
 rename libclc/{generic/lib => opencl/lib/generic}/shared/vstore_half.inc (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/subnormal_config.cl (95%)
 rename libclc/{generic/lib => opencl/lib/generic}/subnormal_disable.ll (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/subnormal_helper_func.ll (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/subnormal_use_default.ll (100%)
 rename libclc/{generic/lib => opencl/lib/generic}/workitem/get_global_id.cl (94%)
 rename libclc/{generic/lib => opencl/lib/generic}/workitem/get_global_size.cl (94%)
 rename libclc/{ptx-nvidiacl/lib => opencl/lib/ptx-nvidiacl}/SOURCES (100%)
 rename libclc/{ptx-nvidiacl/lib => opencl/lib/ptx-nvidiacl}/mem_fence/fence.cl (96%)
 rename libclc/{ptx-nvidiacl/lib => opencl/lib/ptx-nvidiacl}/synchronization/barrier.cl (94%)
 rename libclc/{ptx-nvidiacl/lib => opencl/lib/ptx-nvidiacl}/workitem/get_global_id.cl (94%)
 rename libclc/{ptx-nvidiacl/lib => opencl/lib/ptx-nvidiacl}/workitem/get_group_id.cl (95%)
 rename libclc/{ptx-nvidiacl/lib => opencl/lib/ptx-nvidiacl}/workitem/get_local_id.cl (95%)
 rename libclc/{ptx-nvidiacl/lib => opencl/lib/ptx-nvidiacl}/workitem/get_local_size.cl (95%)
 rename libclc/{ptx-nvidiacl/lib => opencl/lib/ptx-nvidiacl}/workitem/get_num_groups.cl (95%)
 rename libclc/{r600/lib => opencl/lib/r600}/SOURCES (100%)
 rename libclc/{r600/lib => opencl/lib/r600}/SOURCES_3.9 (100%)
 rename libclc/{r600/lib => opencl/lib/r600}/image/get_image_attributes_impl.ll (100%)
 rename libclc/{r600/lib => opencl/lib/r600}/image/get_image_channel_data_type.cl (96%)
 rename libclc/{r600/lib => opencl/lib/r600}/image/get_image_channel_order.cl (96%)
 rename libclc/{r600/lib => opencl/lib/r600}/image/get_image_depth.cl (94%)
 rename libclc/{r600/lib => opencl/lib/r600}/image/get_image_dim.cl (96%)
 rename libclc/{r600/lib => opencl/lib/r600}/image/get_image_height.cl (96%)
 rename libclc/{r600/lib => opencl/lib/r600}/image/get_image_width.cl (96%)
 rename libclc/{r600/lib => opencl/lib/r600}/image/read_image_impl.ll (100%)
 rename libclc/{r600/lib => opencl/lib/r600}/image/read_imagef.cl (96%)
 rename libclc/{r600/lib => opencl/lib/r600}/image/read_imagei.cl (97%)
 rename libclc/{r600/lib => opencl/lib/r600}/image/read_imageui.cl (97%)
 rename libclc/{r600/lib => opencl/lib/r600}/image/write_image_impl.ll (100%)
 rename libclc/{r600/lib => opencl/lib/r600}/image/write_imagef.cl (95%)
 rename libclc/{r600/lib => opencl/lib/r600}/image/write_imagei.cl (95%)
 rename libclc/{r600/lib => opencl/lib/r600}/image/write_imageui.cl (95%)
 rename libclc/{r600/lib => opencl/lib/r600}/synchronization/barrier.cl (95%)
 rename libclc/{r600/lib => opencl/lib/r600}/workitem/get_global_offset.cl (95%)
 rename libclc/{r600/lib => opencl/lib/r600}/workitem/get_global_size.cl (96%)
 rename libclc/{r600/lib => opencl/lib/r600}/workitem/get_group_id.cl (95%)
 rename libclc/{r600/lib => opencl/lib/r600}/workitem/get_local_id.cl (95%)
 rename libclc/{r600/lib => opencl/lib/r600}/workitem/get_local_size.cl (96%)
 rename libclc/{r600/lib => opencl/lib/r600}/workitem/get_num_groups.cl (96%)
 rename libclc/{r600/lib => opencl/lib/r600}/workitem/get_work_dim.cl (95%)
 create mode 100644 libclc/opencl/lib/spirv/SOURCES
 rename libclc/{clspv/lib => opencl/lib/spirv}/math/fma.cl (94%)
 rename libclc/{spirv/lib => opencl/lib/spirv}/subnormal_config.cl (95%)
 delete mode 100644 libclc/spirv/lib/SOURCES
 rename libclc/{generic/lib => utils}/gen_convert.py (99%)

diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index b0e7aac6f8f36..70b11df3b3142 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -18,13 +18,14 @@ include( AddLibclc )
 
 include( GNUInstallDirs )
 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
-  amdgcn-amdhsa/lib/SOURCES;
-  amdgcn/lib/SOURCES;
-  clspv/lib/SOURCES;
-  generic/lib/SOURCES;
-  ptx-nvidiacl/lib/SOURCES;
-  r600/lib/SOURCES;
-  spirv/lib/SOURCES;
+  # OpenCL libraries
+  opencl/lib/amdgcn-amdhsa/SOURCES;
+  opencl/lib/amdgcn/SOURCES;
+  opencl/lib/clspv/SOURCES;
+  opencl/lib/generic/SOURCES;
+  opencl/lib/ptx-nvidiacl/SOURCES;
+  opencl/lib/r600/SOURCES;
+  opencl/lib/spirv/SOURCES;
   # CLC internal libraries
   clc/lib/generic/SOURCES;
   clc/lib/amdgcn/SOURCES;
@@ -227,7 +228,7 @@ if( ENABLE_RUNTIME_SUBNORMAL )
   foreach( file IN ITEMS subnormal_use_default subnormal_disable )
     link_bc(
        TARGET ${file}
-       INPUTS ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/${file}.ll
+       INPUTS ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/${file}.ll
     )
     install(
       FILES $<TARGET_PROPERTY:${file},TARGET_FILE>
@@ -237,7 +238,7 @@ if( ENABLE_RUNTIME_SUBNORMAL )
 endif()
 
 find_package( Python3 REQUIRED COMPONENTS Interpreter )
-file( TO_CMAKE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/gen_convert.py script_loc )
+file( TO_CMAKE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/utils/gen_convert.py script_loc )
 add_custom_command(
   OUTPUT convert.cl
   COMMAND ${Python3_EXECUTABLE} ${script_loc} > convert.cl
@@ -283,20 +284,20 @@ set_source_files_properties(
   ${CMAKE_CURRENT_SOURCE_DIR}/clc/lib/amdgpu/math/clc_native_log10.cl
   ${CMAKE_CURRENT_SOURCE_DIR}/clc/lib/r600/math/clc_native_rsqrt.cl
   # OpenCL builtins
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_cos.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_divide.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_exp.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_exp10.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_exp2.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_log.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_log10.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_log2.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_powr.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_recip.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_rsqrt.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_sin.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_sqrt.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_tan.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_cos.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_divide.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_exp.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_exp10.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_exp2.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_log.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_log10.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_log2.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_powr.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_recip.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_rsqrt.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_sin.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_sqrt.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_tan.cl
   PROPERTIES COMPILE_OPTIONS -fapprox-func
 )
 
@@ -351,7 +352,6 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
 
   libclc_configure_lib_source(
     clc_lib_files
-    CLC_INTERNAL
     LIB_ROOT_DIR clc
     DIRS ${clc_dirs}
   )
@@ -365,13 +365,14 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
     else()
       list( APPEND opencl_gen_files convert.cl )
       if ( NOT ENABLE_RUNTIME_SUBNORMAL )
-        list( APPEND opencl_lib_files generic/lib/subnormal_use_default.ll )
+        list( APPEND opencl_lib_files opencl/lib/generic/subnormal_use_default.ll )
       endif()
     endif()
   endif()
 
   libclc_configure_lib_source(
     opencl_lib_files
+    LIB_ROOT_DIR opencl
     DIRS ${opencl_dirs}
   )
 
@@ -439,7 +440,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
     )
 
     list( APPEND build_flags
-      -I${CMAKE_CURRENT_SOURCE_DIR}/generic/include
+      -I${CMAKE_CURRENT_SOURCE_DIR}/opencl/include
     )
 
     add_libclc_builtin_set(
diff --git a/libclc/clspv/lib/SOURCES b/libclc/clspv/lib/SOURCES
deleted file mode 100644
index d7cd36d09349b..0000000000000
--- a/libclc/clspv/lib/SOURCES
+++ /dev/null
@@ -1,73 +0,0 @@
-math/fma.cl
-shared/vstore_half.cl
-subnormal_config.cl
-../../generic/lib/geometric/distance.cl
-../../generic/lib/geometric/length.cl
-../../generic/lib/math/acos.cl
-../../generic/lib/math/acosh.cl
-../../generic/lib/math/asinh.cl
-../../generic/lib/math/acospi.cl
-../../generic/lib/math/asin.cl
-../../generic/lib/math/atan.cl
-../../generic/lib/math/asinh.cl
-../../generic/lib/math/asinpi.cl
-../../generic/lib/math/atan2.cl
-../../generic/lib/math/atan2pi.cl
-../../generic/lib/math/atanh.cl
-../../generic/lib/math/atanpi.cl
-../../generic/lib/math/cbrt.cl
-../../generic/lib/math/cos.cl
-../../generic/lib/math/cosh.cl
-../../generic/lib/math/cospi.cl
-../../generic/lib/math/erf.cl
-../../generic/lib/math/erfc.cl
-../../generic/lib/math/exp.cl
-../../generic/lib/math/exp10.cl
-../../generic/lib/math/exp2.cl
-../../generic/lib/math/expm1.cl
-../../generic/lib/math/fdim.cl
-../../generic/lib/math/fmod.cl
-../../generic/lib/math/fract.cl
-../../generic/lib/math/frexp.cl
-../../generic/lib/math/half_cos.cl
-../../generic/lib/math/half_divide.cl
-../../generic/lib/math/half_exp.cl
-../../generic/lib/math/half_exp10.cl
-../../generic/lib/math/half_exp2.cl
-../../generic/lib/math/half_log.cl
-../../generic/lib/math/half_log10.cl
-../../generic/lib/math/half_log2.cl
-../../generic/lib/math/half_powr.cl
-../../generic/lib/math/half_recip.cl
-../../generic/lib/math/half_sin.cl
-../../generic/lib/math/half_sqrt.cl
-../../generic/lib/math/half_tan.cl
-../../generic/lib/math/hypot.cl
-../../generic/lib/math/ilogb.cl
-../../generic/lib/math/ldexp.cl
-../../generic/lib/math/lgamma.cl
-../../generic/lib/math/lgamma_r.cl
-../../generic/lib/math/log.cl
-../../generic/lib/math/log10.cl
-../../generic/lib/math/log1p.cl
-../../generic/lib/math/log2.cl
-../../generic/lib/math/logb.cl
-../../generic/lib/math/maxmag.cl
-../../generic/lib/math/minmag.cl
-../../generic/lib/math/modf.cl
-../../generic/lib/math/nan.cl
-../../generic/lib/math/nextafter.cl
-../../generic/lib/math/pow.cl
-../../generic/lib/math/pown.cl
-../../generic/lib/math/powr.cl
-../../generic/lib/math/remainder.cl
-../../generic/lib/math/remquo.cl
-../../generic/lib/math/rootn.cl
-../../generic/lib/math/sin.cl
-../../generic/lib/math/sincos.cl
-../../generic/lib/math/sinh.cl
-../../generic/lib/math/sinpi.cl
-../../generic/lib/math/tan.cl
-../../generic/lib/math/tanh.cl
-../../generic/lib/math/tanpi.cl
-../../generic/lib/math/tgamma.cl
diff --git a/libclc/cmake/modules/AddLibclc.cmake b/libclc/cmake/modules/AddLibclc.cmake
index d00b16a899664..597bb642655e4 100644
--- a/libclc/cmake/modules/AddLibclc.cmake
+++ b/libclc/cmake/modules/AddLibclc.cmake
@@ -424,9 +424,6 @@ endfunction(add_libclc_builtin_set)
 # LIB_FILE_LIST may be pre-populated and is appended to.
 #
 # Arguments:
-# * CLC_INTERNAL
-#     Pass if compiling the internal CLC builtin libraries, which have a
-#     different directory structure.
 # * LIB_ROOT_DIR <string>
 #     Root directory containing target's lib files, relative to libclc root
 #     directory. If not provided, is set to '.'.
@@ -436,7 +433,7 @@ endfunction(add_libclc_builtin_set)
 #     subsequent ones.
 function(libclc_configure_lib_source LIB_FILE_LIST)
   cmake_parse_arguments(ARG
-    "CLC_INTERNAL"
+    ""
     "LIB_ROOT_DIR"
     "DIRS"
     ${ARGN}
@@ -450,11 +447,7 @@ function(libclc_configure_lib_source LIB_FILE_LIST)
   set( source_list )
   foreach( l IN LISTS ARG_DIRS )
     foreach( s "SOURCES" "SOURCES_${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}" )
-      if( ARG_CLC_INTERNAL )
-        file( TO_CMAKE_PATH ${ARG_LIB_ROOT_DIR}/lib/${l}/${s} file_loc )
-      else()
-        file( TO_CMAKE_PATH ${ARG_LIB_ROOT_DIR}/${l}/lib/${s} file_loc )
-      endif()
+      file( TO_CMAKE_PATH ${ARG_LIB_ROOT_DIR}/lib/${l}/${s} file_loc )
       file( TO_CMAKE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${file_loc} loc )
       # Prepend the location to give higher priority to the specialized
       # implementation
diff --git a/libclc/generic/include/clc/clc.h b/libclc/generic/include/clc/clc.h
deleted file mode 100644
index f4c0dc7c0bee4..0000000000000
--- a/libclc/generic/include/clc/clc.h
+++ /dev/null
@@ -1,267 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef __CLC_CLC_H__
-#define __CLC_CLC_H__
-
-#ifndef cl_clang_storage_class_specifiers
-#error Implementation requires cl_clang_storage_class_specifiers extension!
-#endif
-
-#pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable
-
-#ifdef cl_khr_fp64
-#pragma OPENCL EXTENSION cl_khr_fp64 : enable
-#endif
-
-#ifdef cl_khr_fp16
-#pragma OPENCL EXTENSION cl_khr_fp16 : enable
-#endif
-
-/* Function Attributes */
-#include <clc/clcfunc.h>
-
-/* 6.1 Supported Data Types */
-#include <clc/clctypes.h>
-
-/* 6.2.3 Explicit Conversions */
-#include <clc/convert.h>
-
-/* 6.2.4.2 Reinterpreting Types Using as_type() and as_typen() */
-#include <clc/as_type.h>
-
-/* 6.11.1 Work-Item Functions */
-#include <clc/workitem/get_global_size.h>
-#include <clc/workitem/get_global_id.h>
-#include <clc/workitem/get_local_size.h>
-#include <clc/workitem/get_local_id.h>
-#include <clc/workitem/get_num_groups.h>
-#include <clc/workitem/get_group_id.h>
-#include <clc/workitem/get_global_offset.h>
-#include <clc/workitem/get_work_dim.h>
-
-/* 6.11.2 Math Functions */
-#include <clc/math/acos.h>
-#include <clc/math/acosh.h>
-#include <clc/math/acospi.h>
-#include <clc/math/asin.h>
-#include <clc/math/asinh.h>
-#include <clc/math/asinpi.h>
-#include <clc/math/atan.h>
-#include <clc/math/atan2.h>
-#include <clc/math/atan2pi.h>
-#include <clc/math/atanh.h>
-#include <clc/math/atanpi.h>
-#include <clc/math/cbrt.h>
-#include <clc/math/copysign.h>
-#include <clc/math/cos.h>
-#include <clc/math/cosh.h>
-#include <clc/math/cospi.h>
-#include <clc/math/ceil.h>
-#include <clc/math/erf.h>
-#include <clc/math/erfc.h>
-#include <clc/math/exp.h>
-#include <clc/math/expm1.h>
-#include <clc/math/exp10.h>
-#include <clc/math/exp2.h>
-#include <clc/math/fabs.h>
-#include <clc/math/fdim.h>
-#include <clc/math/floor.h>
-#include <clc/math/fma.h>
-#include <clc/math/fmax.h>
-#include <clc/math/fmin.h>
-#include <clc/math/fmod.h>
-#include <clc/math/fract.h>
-#include <clc/math/frexp.h>
-#include <clc/math/half_cos.h>
-#include <clc/math/half_divide.h>
-#include <clc/math/half_exp.h>
-#include <clc/math/half_exp10.h>
-#include <clc/math/half_exp2.h>
-#include <clc/math/half_log.h>
-#include <clc/math/half_log10.h>
-#include <clc/math/half_log2.h>
-#include <clc/math/half_powr.h>
-#include <clc/math/half_recip.h>
-#include <clc/math/half_rsqrt.h>
-#include <clc/math/half_sin.h>
-#include <clc/math/half_sqrt.h>
-#include <clc/math/half_tan.h>
-#include <clc/math/hypot.h>
-#include <clc/math/ilogb.h>
-#include <clc/math/ldexp.h>
-#include <clc/math/lgamma.h>
-#include <clc/math/lgamma_r.h>
-#include <clc/math/log.h>
-#include <clc/math/log10.h>
-#include <clc/math/log1p.h>
-#include <clc/math/log2.h>
-#include <clc/math/logb.h>
-#include <clc/math/mad.h>
-#include <clc/math/maxmag.h>
-#include <clc/math/minmag.h>
-#include <clc/math/modf.h>
-#include <clc/math/nan.h>
-#include <clc/math/nextafter.h>
-#include <clc/math/pow.h>
-#include <clc/math/pown.h>
-#include <clc/math/powr.h>
-#include <clc/math/remainder.h>
-#include <clc/math/remquo.h>
-#include <clc/math/rint.h>
-#include <clc/math/rootn.h>
-#include <clc/math/round.h>
-#include <clc/math/sin.h>
-#include <clc/math/sincos.h>
-#include <clc/math/sinh.h>
-#include <clc/math/sinpi.h>
-#include <clc/math/sqrt.h>
-#include <clc/math/tan.h>
-#include <clc/math/tanh.h>
-#include <clc/math/tanpi.h>
-#include <clc/math/tgamma.h>
-#include <clc/math/trunc.h>
-#include <clc/math/native_cos.h>
-#include <clc/math/native_divide.h>
-#include <clc/math/native_exp.h>
-#include <clc/math/native_exp10.h>
-#include <clc/math/native_exp2.h>
-#include <clc/math/native_log.h>
-#include <clc/math/native_log10.h>
-#include <clc/math/native_log2.h>
-#include <clc/math/native_powr.h>
-#include <clc/math/native_recip.h>
-#include <clc/math/native_sin.h>
-#include <clc/math/native_sqrt.h>
-#include <clc/math/native_rsqrt.h>
-#include <clc/math/native_tan.h>
-#include <clc/math/rsqrt.h>
-
-/* 6.11.2.1 Floating-point macros */
-#include <clc/float/definitions.h>
-
-/* 6.11.3 Integer Functions */
-#include <clc/integer/abs.h>
-#include <clc/integer/abs_diff.h>
-#include <clc/integer/add_sat.h>
-#include <clc/integer/clz.h>
-#include <clc/integer/ctz.h>
-#include <clc/integer/hadd.h>
-#include <clc/integer/mad24.h>
-#include <clc/integer/mad_hi.h>
-#include <clc/integer/mad_sat.h>
-#include <clc/integer/mul24.h>
-#include <clc/integer/mul_hi.h>
-#include <clc/integer/popcount.h>
-#include <clc/integer/rhadd.h>
-#include <clc/integer/rotate.h>
-#include <clc/integer/sub_sat.h>
-#include <clc/integer/upsample.h>
-
-/* 6.11.3 Integer Definitions */
-#include <clc/integer/definitions.h>
-
-/* 6.11.2 and 6.11.3 Shared Integer/Math Functions */
-#include <clc/shared/clamp.h>
-#include <clc/shared/max.h>
-#include <clc/shared/min.h>
-#include <clc/shared/vload.h>
-#include <clc/shared/vstore.h>
-
-/* 6.11.4 Common Functions */
-#include <clc/common/degrees.h>
-#include <clc/common/radians.h>
-#include <clc/common/mix.h>
-#include <clc/common/sign.h>
-#include <clc/common/smoothstep.h>
-#include <clc/common/step.h>
-
-/* 6.11.5 Geometric Functions */
-#include <clc/geometric/cross.h>
-#include <clc/geometric/distance.h>
-#include <clc/geometric/dot.h>
-#include <clc/geometric/fast_distance.h>
-#include <clc/geometric/fast_length.h>
-#include <clc/geometric/fast_normalize.h>
-#include <clc/geometric/length.h>
-#include <clc/geometric/normalize.h>
-
-/* 6.11.6 Relational Functions */
-#include <clc/relational/all.h>
-#include <clc/relational/any.h>
-#include <clc/relational/bitselect.h>
-#include <clc/relational/isequal.h>
-#include <clc/relational/isfinite.h>
-#include <clc/relational/isgreater.h>
-#include <clc/relational/isgreaterequal.h>
-#include <clc/relational/isinf.h>
-#include <clc/relational/isless.h>
-#include <clc/relational/islessequal.h>
-#include <clc/relational/islessgreater.h>
-#include <clc/relational/isnan.h>
-#include <clc/relational/isnormal.h>
-#include <clc/relational/isnotequal.h>
-#include <clc/relational/isordered.h>
-#include <clc/relational/isunordered.h>
-#include <clc/relational/select.h>
-#include <clc/relational/signbit.h>
-
-/* 6.11.8 Synchronization Functions */
-#include <clc/synchronization/cl_mem_fence_flags.h>
-#include <clc/synchronization/barrier.h>
-
-/* 6.11.9 Explicit Memory Fence Functions */
-#include <clc/explicit_fence/explicit_memory_fence.h>
-
-/* 6.11.10 Async Copy and Prefetch Functions */
-#include <clc/async/async_work_group_copy.h>
-#include <clc/async/async_work_group_strided_copy.h>
-#include <clc/async/prefetch.h>
-#include <clc/async/wait_group_events.h>
-
-/* 6.11.11 Atomic Functions */
-#include <clc/atomic/atomic_add.h>
-#include <clc/atomic/atomic_and.h>
-#include <clc/atomic/atomic_cmpxchg.h>
-#include <clc/atomic/atomic_dec.h>
-#include <clc/atomic/atomic_inc.h>
-#include <clc/atomic/atomic_max.h>
-#include <clc/atomic/atomic_min.h>
-#include <clc/atomic/atomic_or.h>
-#include <clc/atomic/atomic_sub.h>
-#include <clc/atomic/atomic_xchg.h>
-#include <clc/atomic/atomic_xor.h>
-
-/* cl_khr_global_int32_base_atomics, cl_khr_local_int32_base_atomics and
- * cl_khr_int64_base_atomics Extension Functions */
-#include <clc/atomic/atom_add.h>
-#include <clc/atomic/atom_cmpxchg.h>
-#include <clc/atomic/atom_dec.h>
-#include <clc/atomic/atom_inc.h>
-#include <clc/atomic/atom_sub.h>
-#include <clc/atomic/atom_xchg.h>
-
-/* cl_khr_global_int32_extended_atomics, cl_khr_local_int32_extended_atomics and
- * cl_khr_int64_extended_atomics Extension Functions */
-#include <clc/atomic/atom_and.h>
-#include <clc/atomic/atom_max.h>
-#include <clc/atomic/atom_min.h>
-#include <clc/atomic/atom_or.h>
-#include <clc/atomic/atom_xor.h>
-
-/* 6.12.12 Miscellaneous Vector Functions */
-#include <clc/misc/shuffle.h>
-#include <clc/misc/shuffle2.h>
-
-/* 6.11.13 Image Read and Write Functions */
-#include <clc/image/image_defines.h>
-#include <clc/image/image.h>
-
-#pragma OPENCL EXTENSION all : disable
-
-#endif // __CLC_CLC_H__
diff --git a/libclc/generic/include/clc/common/degrees.inc b/libclc/generic/include/clc/common/degrees.inc
deleted file mode 100644
index d881decc9ca33..0000000000000
--- a/libclc/generic/include/clc/common/degrees.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE degrees(__CLC_GENTYPE x);
diff --git a/libclc/generic/include/clc/common/radians.inc b/libclc/generic/include/clc/common/radians.inc
deleted file mode 100644
index 763225a87d5c8..0000000000000
--- a/libclc/generic/include/clc/common/radians.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE radians(__CLC_GENTYPE x);
diff --git a/libclc/generic/include/clc/integer/add_sat.inc b/libclc/generic/include/clc/integer/add_sat.inc
deleted file mode 100644
index aa7de2c9ca337..0000000000000
--- a/libclc/generic/include/clc/integer/add_sat.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE add_sat(__CLC_GENTYPE x, __CLC_GENTYPE y);
diff --git a/libclc/generic/include/clc/integer/mad_sat.inc b/libclc/generic/include/clc/integer/mad_sat.inc
deleted file mode 100644
index 4e6e0a4f19d10..0000000000000
--- a/libclc/generic/include/clc/integer/mad_sat.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mad_sat(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_GENTYPE z);
diff --git a/libclc/generic/include/clc/integer/rotate.inc b/libclc/generic/include/clc/integer/rotate.inc
deleted file mode 100644
index af4782ceb3b32..0000000000000
--- a/libclc/generic/include/clc/integer/rotate.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE rotate(__CLC_GENTYPE x, __CLC_GENTYPE y);
diff --git a/libclc/generic/include/clc/integer/sub_sat.inc b/libclc/generic/include/clc/integer/sub_sat.inc
deleted file mode 100644
index 222c191bb96d5..0000000000000
--- a/libclc/generic/include/clc/integer/sub_sat.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sub_sat(__CLC_GENTYPE x, __CLC_GENTYPE y);
diff --git a/libclc/generic/include/clc/integer/unary.inc b/libclc/generic/include/clc/integer/unary.inc
deleted file mode 100644
index 5d742de00b711..0000000000000
--- a/libclc/generic/include/clc/integer/unary.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x);
diff --git a/libclc/generic/include/clc/as_type.h b/libclc/opencl/include/clc/opencl/as_type.h
similarity index 100%
rename from libclc/generic/include/clc/as_type.h
rename to libclc/opencl/include/clc/opencl/as_type.h
diff --git a/libclc/generic/include/clc/async/async_work_group_copy.h b/libclc/opencl/include/clc/opencl/async/async_work_group_copy.h
similarity index 74%
rename from libclc/generic/include/clc/async/async_work_group_copy.h
rename to libclc/opencl/include/clc/opencl/async/async_work_group_copy.h
index 81da21cd94d54..14420b3c9eeac 100644
--- a/libclc/generic/include/clc/async/async_work_group_copy.h
+++ b/libclc/opencl/include/clc/opencl/async/async_work_group_copy.h
@@ -8,18 +8,18 @@
 
 #define __CLC_DST_ADDR_SPACE local
 #define __CLC_SRC_ADDR_SPACE global
-#define __CLC_BODY <clc/async/async_work_group_copy.inc>
+#define __CLC_BODY <clc/opencl/async/async_work_group_copy.inc>
 #include <clc/integer/gentype.inc>
-#define __CLC_BODY <clc/async/async_work_group_copy.inc>
+#define __CLC_BODY <clc/opencl/async/async_work_group_copy.inc>
 #include <clc/math/gentype.inc>
 #undef __CLC_DST_ADDR_SPACE
 #undef __CLC_SRC_ADDR_SPACE
 
 #define __CLC_DST_ADDR_SPACE global
 #define __CLC_SRC_ADDR_SPACE local
-#define __CLC_BODY <clc/async/async_work_group_copy.inc>
+#define __CLC_BODY <clc/opencl/async/async_work_group_copy.inc>
 #include <clc/integer/gentype.inc>
-#define __CLC_BODY <clc/async/async_work_group_copy.inc>
+#define __CLC_BODY <clc/opencl/async/async_work_group_copy.inc>
 #include <clc/math/gentype.inc>
 #undef __CLC_DST_ADDR_SPACE
 #undef __CLC_SRC_ADDR_SPACE
diff --git a/libclc/generic/include/clc/async/async_work_group_copy.inc b/libclc/opencl/include/clc/opencl/async/async_work_group_copy.inc
similarity index 100%
rename from libclc/generic/include/clc/async/async_work_group_copy.inc
rename to libclc/opencl/include/clc/opencl/async/async_work_group_copy.inc
diff --git a/libclc/generic/include/clc/async/async_work_group_strided_copy.h b/libclc/opencl/include/clc/opencl/async/async_work_group_strided_copy.h
similarity index 72%
rename from libclc/generic/include/clc/async/async_work_group_strided_copy.h
rename to libclc/opencl/include/clc/opencl/async/async_work_group_strided_copy.h
index a32e958f81ced..fd37e35f18c5b 100644
--- a/libclc/generic/include/clc/async/async_work_group_strided_copy.h
+++ b/libclc/opencl/include/clc/opencl/async/async_work_group_strided_copy.h
@@ -8,18 +8,18 @@
 
 #define __CLC_DST_ADDR_SPACE local
 #define __CLC_SRC_ADDR_SPACE global
-#define __CLC_BODY <clc/async/async_work_group_strided_copy.inc>
+#define __CLC_BODY <clc/opencl/async/async_work_group_strided_copy.inc>
 #include <clc/integer/gentype.inc>
-#define __CLC_BODY <clc/async/async_work_group_strided_copy.inc>
+#define __CLC_BODY <clc/opencl/async/async_work_group_strided_copy.inc>
 #include <clc/math/gentype.inc>
 #undef __CLC_DST_ADDR_SPACE
 #undef __CLC_SRC_ADDR_SPACE
 
 #define __CLC_DST_ADDR_SPACE global
 #define __CLC_SRC_ADDR_SPACE local
-#define __CLC_BODY <clc/async/async_work_group_strided_copy.inc>
+#define __CLC_BODY <clc/opencl/async/async_work_group_strided_copy.inc>
 #include <clc/integer/gentype.inc>
-#define __CLC_BODY <clc/async/async_work_group_strided_copy.inc>
+#define __CLC_BODY <clc/opencl/async/async_work_group_strided_copy.inc>
 #include <clc/math/gentype.inc>
 #undef __CLC_DST_ADDR_SPACE
 #undef __CLC_SRC_ADDR_SPACE
diff --git a/libclc/generic/include/clc/async/async_work_group_strided_copy.inc b/libclc/opencl/include/clc/opencl/async/async_work_group_strided_copy.inc
similarity index 100%
rename from libclc/generic/include/clc/async/async_work_group_strided_copy.inc
rename to libclc/opencl/include/clc/opencl/async/async_work_group_strided_copy.inc
diff --git a/libclc/generic/include/clc/async/prefetch.h b/libclc/opencl/include/clc/opencl/async/prefetch.h
similarity index 81%
rename from libclc/generic/include/clc/async/prefetch.h
rename to libclc/opencl/include/clc/opencl/async/prefetch.h
index 01fc9215fa5e6..5075dcaee1409 100644
--- a/libclc/generic/include/clc/async/prefetch.h
+++ b/libclc/opencl/include/clc/opencl/async/prefetch.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/async/prefetch.inc>
+#define __CLC_BODY <clc/opencl/async/prefetch.inc>
 #include <clc/integer/gentype.inc>
 
-#define __CLC_BODY <clc/async/prefetch.inc>
+#define __CLC_BODY <clc/opencl/async/prefetch.inc>
 #include <clc/math/gentype.inc>
diff --git a/libclc/generic/include/clc/async/prefetch.inc b/libclc/opencl/include/clc/opencl/async/prefetch.inc
similarity index 100%
rename from libclc/generic/include/clc/async/prefetch.inc
rename to libclc/opencl/include/clc/opencl/async/prefetch.inc
diff --git a/libclc/generic/include/clc/async/wait_group_events.h b/libclc/opencl/include/clc/opencl/async/wait_group_events.h
similarity index 100%
rename from libclc/generic/include/clc/async/wait_group_events.h
rename to libclc/opencl/include/clc/opencl/async/wait_group_events.h
diff --git a/libclc/generic/include/clc/atomic/atom_add.h b/libclc/opencl/include/clc/opencl/atomic/atom_add.h
similarity index 83%
rename from libclc/generic/include/clc/atomic/atom_add.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_add.h
index b6eff1dea241a..62c73d99371fb 100644
--- a/libclc/generic/include/clc/atomic/atom_add.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atom_add.h
@@ -9,16 +9,16 @@
 #ifdef cl_khr_global_int32_base_atomics
 #define __CLC_FUNCTION atom_add
 #define __CLC_ADDRESS_SPACE global
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_global_int32_base_atomics
 
 #ifdef cl_khr_local_int32_base_atomics
 #define __CLC_FUNCTION atom_add
 #define __CLC_ADDRESS_SPACE local
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_local_int32_base_atomics
 
 #ifdef cl_khr_int64_base_atomics
 #define __CLC_FUNCTION atom_add
-#include <clc/atomic/atom_decl_int64.inc>
+#include <clc/opencl/atomic/atom_decl_int64.inc>
 #endif // cl_khr_int64_base_atomics
diff --git a/libclc/generic/include/clc/atomic/atom_and.h b/libclc/opencl/include/clc/opencl/atomic/atom_and.h
similarity index 84%
rename from libclc/generic/include/clc/atomic/atom_and.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_and.h
index 96c4ebb126daa..9dd9466f62f86 100644
--- a/libclc/generic/include/clc/atomic/atom_and.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atom_and.h
@@ -9,16 +9,16 @@
 #ifdef cl_khr_global_int32_extended_atomics
 #define __CLC_FUNCTION atom_and
 #define __CLC_ADDRESS_SPACE global
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_global_int32_extended_atomics
 
 #ifdef cl_khr_local_int32_extended_atomics
 #define __CLC_FUNCTION atom_and
 #define __CLC_ADDRESS_SPACE local
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_local_int32_extended_atomics
 
 #ifdef cl_khr_int64_extended_atomics
 #define __CLC_FUNCTION atom_and
-#include <clc/atomic/atom_decl_int64.inc>
+#include <clc/opencl/atomic/atom_decl_int64.inc>
 #endif // cl_khr_int64_extended_atomics
diff --git a/libclc/generic/include/clc/atomic/atom_cmpxchg.h b/libclc/opencl/include/clc/opencl/atomic/atom_cmpxchg.h
similarity index 100%
rename from libclc/generic/include/clc/atomic/atom_cmpxchg.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_cmpxchg.h
diff --git a/libclc/generic/include/clc/atomic/atom_dec.h b/libclc/opencl/include/clc/opencl/atomic/atom_dec.h
similarity index 100%
rename from libclc/generic/include/clc/atomic/atom_dec.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_dec.h
diff --git a/libclc/generic/include/clc/atomic/atom_decl_int32.inc b/libclc/opencl/include/clc/opencl/atomic/atom_decl_int32.inc
similarity index 100%
rename from libclc/generic/include/clc/atomic/atom_decl_int32.inc
rename to libclc/opencl/include/clc/opencl/atomic/atom_decl_int32.inc
diff --git a/libclc/generic/include/clc/atomic/atom_decl_int64.inc b/libclc/opencl/include/clc/opencl/atomic/atom_decl_int64.inc
similarity index 100%
rename from libclc/generic/include/clc/atomic/atom_decl_int64.inc
rename to libclc/opencl/include/clc/opencl/atomic/atom_decl_int64.inc
diff --git a/libclc/generic/include/clc/atomic/atom_inc.h b/libclc/opencl/include/clc/opencl/atomic/atom_inc.h
similarity index 100%
rename from libclc/generic/include/clc/atomic/atom_inc.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_inc.h
diff --git a/libclc/generic/include/clc/atomic/atom_max.h b/libclc/opencl/include/clc/opencl/atomic/atom_max.h
similarity index 84%
rename from libclc/generic/include/clc/atomic/atom_max.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_max.h
index 8cb601be5d6ea..00b47e6b14fde 100644
--- a/libclc/generic/include/clc/atomic/atom_max.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atom_max.h
@@ -9,16 +9,16 @@
 #ifdef cl_khr_global_int32_extended_atomics
 #define __CLC_FUNCTION atom_max
 #define __CLC_ADDRESS_SPACE global
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_global_int32_extended_atomics
 
 #ifdef cl_khr_local_int32_extended_atomics
 #define __CLC_FUNCTION atom_max
 #define __CLC_ADDRESS_SPACE local
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_local_int32_extended_atomics
 
 #ifdef cl_khr_int64_extended_atomics
 #define __CLC_FUNCTION atom_max
-#include <clc/atomic/atom_decl_int64.inc>
+#include <clc/opencl/atomic/atom_decl_int64.inc>
 #endif // cl_khr_int64_extended_atomics
diff --git a/libclc/generic/include/clc/atomic/atom_min.h b/libclc/opencl/include/clc/opencl/atomic/atom_min.h
similarity index 84%
rename from libclc/generic/include/clc/atomic/atom_min.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_min.h
index 67853c999b2e4..40bed0dc086f2 100644
--- a/libclc/generic/include/clc/atomic/atom_min.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atom_min.h
@@ -9,16 +9,16 @@
 #ifdef cl_khr_global_int32_extended_atomics
 #define __CLC_FUNCTION atom_min
 #define __CLC_ADDRESS_SPACE global
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_global_int32_extended_atomics
 
 #ifdef cl_khr_local_int32_extended_atomics
 #define __CLC_FUNCTION atom_min
 #define __CLC_ADDRESS_SPACE local
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_local_int32_extended_atomics
 
 #ifdef cl_khr_int64_extended_atomics
 #define __CLC_FUNCTION atom_min
-#include <clc/atomic/atom_decl_int64.inc>
+#include <clc/opencl/atomic/atom_decl_int64.inc>
 #endif // cl_khr_int64_extended_atomics
diff --git a/libclc/generic/include/clc/atomic/atom_or.h b/libclc/opencl/include/clc/opencl/atomic/atom_or.h
similarity index 84%
rename from libclc/generic/include/clc/atomic/atom_or.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_or.h
index 7930ab0c5692e..2c0beb850b4d0 100644
--- a/libclc/generic/include/clc/atomic/atom_or.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atom_or.h
@@ -9,16 +9,16 @@
 #ifdef cl_khr_global_int32_extended_atomics
 #define __CLC_FUNCTION atom_or
 #define __CLC_ADDRESS_SPACE global
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_global_int32_extended_atomics
 
 #ifdef cl_khr_local_int32_extended_atomics
 #define __CLC_FUNCTION atom_or
 #define __CLC_ADDRESS_SPACE local
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_local_int32_extended_atomics
 
 #ifdef cl_khr_int64_extended_atomics
 #define __CLC_FUNCTION atom_or
-#include <clc/atomic/atom_decl_int64.inc>
+#include <clc/opencl/atomic/atom_decl_int64.inc>
 #endif // cl_khr_int64_extended_atomics
diff --git a/libclc/generic/include/clc/atomic/atom_sub.h b/libclc/opencl/include/clc/opencl/atomic/atom_sub.h
similarity index 83%
rename from libclc/generic/include/clc/atomic/atom_sub.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_sub.h
index 11eb25524c211..36074aaef5a32 100644
--- a/libclc/generic/include/clc/atomic/atom_sub.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atom_sub.h
@@ -9,16 +9,16 @@
 #ifdef cl_khr_global_int32_base_atomics
 #define __CLC_FUNCTION atom_sub
 #define __CLC_ADDRESS_SPACE global
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_global_int32_base_atomics
 
 #ifdef cl_khr_local_int32_base_atomics
 #define __CLC_FUNCTION atom_sub
 #define __CLC_ADDRESS_SPACE local
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_local_int32_base_atomics
 
 #ifdef cl_khr_int64_base_atomics
 #define __CLC_FUNCTION atom_sub
-#include <clc/atomic/atom_decl_int64.inc>
+#include <clc/opencl/atomic/atom_decl_int64.inc>
 #endif // cl_khr_int64_base_atomics
diff --git a/libclc/generic/include/clc/atomic/atom_xchg.h b/libclc/opencl/include/clc/opencl/atomic/atom_xchg.h
similarity index 84%
rename from libclc/generic/include/clc/atomic/atom_xchg.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_xchg.h
index 4a46536c24512..a5043aa4109ed 100644
--- a/libclc/generic/include/clc/atomic/atom_xchg.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atom_xchg.h
@@ -9,16 +9,16 @@
 #ifdef cl_khr_global_int32_base_atomics
 #define __CLC_FUNCTION atom_xchg
 #define __CLC_ADDRESS_SPACE global
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_global_int32_base_atomics
 
 #ifdef cl_khr_local_int32_base_atomics
 #define __CLC_FUNCTION atom_xchg
 #define __CLC_ADDRESS_SPACE local
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_local_int32_base_atomics
 
 #ifdef cl_khr_int64_base_atomics
 #define __CLC_FUNCTION atom_xchg
-#include <clc/atomic/atom_decl_int64.inc>
+#include <clc/opencl/atomic/atom_decl_int64.inc>
 #endif // cl_khr_int64_base_atomics
diff --git a/libclc/generic/include/clc/atomic/atom_xor.h b/libclc/opencl/include/clc/opencl/atomic/atom_xor.h
similarity index 84%
rename from libclc/generic/include/clc/atomic/atom_xor.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_xor.h
index ad8ae554e15a2..0c4b456b8f23f 100644
--- a/libclc/generic/include/clc/atomic/atom_xor.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atom_xor.h
@@ -9,16 +9,16 @@
 #ifdef cl_khr_global_int32_extended_atomics
 #define __CLC_FUNCTION atom_xor
 #define __CLC_ADDRESS_SPACE global
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_global_int32_extended_atomics
 
 #ifdef cl_khr_local_int32_extended_atomics
 #define __CLC_FUNCTION atom_xor
 #define __CLC_ADDRESS_SPACE local
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_local_int32_extended_atomics
 
 #ifdef cl_khr_int64_extended_atomics
 #define __CLC_FUNCTION atom_xor
-#include <clc/atomic/atom_decl_int64.inc>
+#include <clc/opencl/atomic/atom_decl_int64.inc>
 #endif // cl_khr_int64_extended_atomics
diff --git a/libclc/generic/include/clc/atomic/atomic_add.h b/libclc/opencl/include/clc/opencl/atomic/atomic_add.h
similarity index 89%
rename from libclc/generic/include/clc/atomic/atomic_add.h
rename to libclc/opencl/include/clc/opencl/atomic/atomic_add.h
index 59ed14557b69f..937def3f4a2ae 100644
--- a/libclc/generic/include/clc/atomic/atomic_add.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_add.h
@@ -7,4 +7,4 @@
 //===----------------------------------------------------------------------===//
 
 #define __CLC_FUNCTION atomic_add
-#include <clc/atomic/atomic_decl.inc>
+#include <clc/opencl/atomic/atomic_decl.inc>
diff --git a/libclc/generic/include/clc/atomic/atomic_and.h b/libclc/opencl/include/clc/opencl/atomic/atomic_and.h
similarity index 89%
rename from libclc/generic/include/clc/atomic/atomic_and.h
rename to libclc/opencl/include/clc/opencl/atomic/atomic_and.h
index 366396a5f26a6..5f353f40318f6 100644
--- a/libclc/generic/include/clc/atomic/atomic_and.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_and.h
@@ -7,4 +7,4 @@
 //===----------------------------------------------------------------------===//
 
 #define __CLC_FUNCTION atomic_and
-#include <clc/atomic/atomic_decl.inc>
+#include <clc/opencl/atomic/atomic_decl.inc>
diff --git a/libclc/generic/include/clc/atomic/atomic_cmpxchg.h b/libclc/opencl/include/clc/opencl/atomic/atomic_cmpxchg.h
similarity index 100%
rename from libclc/generic/include/clc/atomic/atomic_cmpxchg.h
rename to libclc/opencl/include/clc/opencl/atomic/atomic_cmpxchg.h
diff --git a/libclc/generic/include/clc/atomic/atomic_dec.h b/libclc/opencl/include/clc/opencl/atomic/atomic_dec.h
similarity index 100%
rename from libclc/generic/include/clc/atomic/atomic_dec.h
rename to libclc/opencl/include/clc/opencl/atomic/atomic_dec.h
diff --git a/libclc/generic/include/clc/atomic/atomic_decl.inc b/libclc/opencl/include/clc/opencl/atomic/atomic_decl.inc
similarity index 100%
rename from libclc/generic/include/clc/atomic/atomic_decl.inc
rename to libclc/opencl/include/clc/opencl/atomic/atomic_decl.inc
diff --git a/libclc/generic/include/clc/atomic/atomic_inc.h b/libclc/opencl/include/clc/opencl/atomic/atomic_inc.h
similarity index 100%
rename from libclc/generic/include/clc/atomic/atomic_inc.h
rename to libclc/opencl/include/clc/opencl/atomic/atomic_inc.h
diff --git a/libclc/generic/include/clc/atomic/atomic_max.h b/libclc/opencl/include/clc/opencl/atomic/atomic_max.h
similarity index 89%
rename from libclc/generic/include/clc/atomic/atomic_max.h
rename to libclc/opencl/include/clc/opencl/atomic/atomic_max.h
index 4d96e948e6c8d..13832423cfeec 100644
--- a/libclc/generic/include/clc/atomic/atomic_max.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_max.h
@@ -7,4 +7,4 @@
 //===----------------------------------------------------------------------===//
 
 #define __CLC_FUNCTION atomic_max
-#include <clc/atomic/atomic_decl.inc>
+#include <clc/opencl/atomic/atomic_decl.inc>
diff --git a/libclc/generic/include/clc/atomic/atomic_min.h b/libclc/opencl/include/clc/opencl/atomic/atomic_min.h
similarity index 89%
rename from libclc/generic/include/clc/atomic/atomic_min.h
rename to libclc/opencl/include/clc/opencl/atomic/atomic_min.h
index 5f3dcc4e7cdc0..3bd47a3f7837d 100644
--- a/libclc/generic/include/clc/atomic/atomic_min.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_min.h
@@ -7,4 +7,4 @@
 //===----------------------------------------------------------------------===//
 
 #define __CLC_FUNCTION atomic_min
-#include <clc/atomic/atomic_decl.inc>
+#include <clc/opencl/atomic/atomic_decl.inc>
diff --git a/libclc/generic/include/clc/atomic/atomic_or.h b/libclc/opencl/include/clc/opencl/atomic/atomic_or.h
similarity index 89%
rename from libclc/generic/include/clc/atomic/atomic_or.h
rename to libclc/opencl/include/clc/opencl/atomic/atomic_or.h
index 5af595dcdd66f..13f84ea49a5ab 100644
--- a/libclc/generic/include/clc/atomic/atomic_or.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_or.h
@@ -7,4 +7,4 @@
 //===----------------------------------------------------------------------===//
 
 #define __CLC_FUNCTION atomic_or
-#include <clc/atomic/atomic_decl.inc>
+#include <clc/opencl/atomic/atomic_decl.inc>
diff --git a/libclc/generic/include/clc/atomic/atomic_sub.h b/libclc/opencl/include/clc/opencl/atomic/atomic_sub.h
similarity index 89%
rename from libclc/generic/include/clc/atomic/atomic_sub.h
rename to libclc/opencl/include/clc/opencl/atomic/atomic_sub.h
index 2712a8ad2a4aa..eedc9d0e76054 100644
--- a/libclc/generic/include/clc/atomic/atomic_sub.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_sub.h
@@ -7,4 +7,4 @@
 //===----------------------------------------------------------------------===//
 
 #define __CLC_FUNCTION atomic_sub
-#include <clc/atomic/atomic_decl.inc>
+#include <clc/opencl/atomic/atomic_decl.inc>
diff --git a/libclc/generic/include/clc/atomic/atomic_xchg.h b/libclc/opencl/include/clc/opencl/atomic/atomic_xchg.h
similarity index 92%
rename from libclc/generic/include/clc/atomic/atomic_xchg.h
rename to libclc/opencl/include/clc/opencl/atomic/atomic_xchg.h
index 050aec887b0ec..efad65567aae3 100644
--- a/libclc/generic/include/clc/atomic/atomic_xchg.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_xchg.h
@@ -10,4 +10,4 @@
 
 _CLC_OVERLOAD _CLC_DECL float __CLC_FUNCTION (volatile local float *, float);
 _CLC_OVERLOAD _CLC_DECL float __CLC_FUNCTION (volatile global float *, float);
-#include <clc/atomic/atomic_decl.inc>
+#include <clc/opencl/atomic/atomic_decl.inc>
diff --git a/libclc/generic/include/clc/atomic/atomic_xor.h b/libclc/opencl/include/clc/opencl/atomic/atomic_xor.h
similarity index 89%
rename from libclc/generic/include/clc/atomic/atomic_xor.h
rename to libclc/opencl/include/clc/opencl/atomic/atomic_xor.h
index 699299ca00a30..6f6b4564fdf3c 100644
--- a/libclc/generic/include/clc/atomic/atomic_xor.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_xor.h
@@ -7,4 +7,4 @@
 //===----------------------------------------------------------------------===//
 
 #define __CLC_FUNCTION atomic_xor
-#include <clc/atomic/atomic_decl.inc>
+#include <clc/opencl/atomic/atomic_decl.inc>
diff --git a/libclc/opencl/include/clc/opencl/clc.h b/libclc/opencl/include/clc/opencl/clc.h
new file mode 100644
index 0000000000000..c23ad3354fd2d
--- /dev/null
+++ b/libclc/opencl/include/clc/opencl/clc.h
@@ -0,0 +1,267 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __CLC_OPENCL_CLC_H__
+#define __CLC_OPENCL_CLC_H__
+
+#ifndef cl_clang_storage_class_specifiers
+#error Implementation requires cl_clang_storage_class_specifiers extension!
+#endif
+
+#pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable
+
+#ifdef cl_khr_fp64
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+#endif
+
+#ifdef cl_khr_fp16
+#pragma OPENCL EXTENSION cl_khr_fp16 : enable
+#endif
+
+/* Function Attributes */
+#include <clc/clcfunc.h>
+
+/* 6.1 Supported Data Types */
+#include <clc/clctypes.h>
+
+/* 6.2.3 Explicit Conversions */
+#include <clc/opencl/convert.h>
+
+/* 6.2.4.2 Reinterpreting Types Using as_type() and as_typen() */
+#include <clc/opencl/as_type.h>
+
+/* 6.11.1 Work-Item Functions */
+#include <clc/opencl/workitem/get_global_size.h>
+#include <clc/opencl/workitem/get_global_id.h>
+#include <clc/opencl/workitem/get_local_size.h>
+#include <clc/opencl/workitem/get_local_id.h>
+#include <clc/opencl/workitem/get_num_groups.h>
+#include <clc/opencl/workitem/get_group_id.h>
+#include <clc/opencl/workitem/get_global_offset.h>
+#include <clc/opencl/workitem/get_work_dim.h>
+
+/* 6.11.2 Math Functions */
+#include <clc/opencl/math/acos.h>
+#include <clc/opencl/math/acosh.h>
+#include <clc/opencl/math/acospi.h>
+#include <clc/opencl/math/asin.h>
+#include <clc/opencl/math/asinh.h>
+#include <clc/opencl/math/asinpi.h>
+#include <clc/opencl/math/atan.h>
+#include <clc/opencl/math/atan2.h>
+#include <clc/opencl/math/atan2pi.h>
+#include <clc/opencl/math/atanh.h>
+#include <clc/opencl/math/atanpi.h>
+#include <clc/opencl/math/cbrt.h>
+#include <clc/opencl/math/copysign.h>
+#include <clc/opencl/math/cos.h>
+#include <clc/opencl/math/cosh.h>
+#include <clc/opencl/math/cospi.h>
+#include <clc/opencl/math/ceil.h>
+#include <clc/opencl/math/erf.h>
+#include <clc/opencl/math/erfc.h>
+#include <clc/opencl/math/exp.h>
+#include <clc/opencl/math/expm1.h>
+#include <clc/opencl/math/exp10.h>
+#include <clc/opencl/math/exp2.h>
+#include <clc/opencl/math/fabs.h>
+#include <clc/opencl/math/fdim.h>
+#include <clc/opencl/math/floor.h>
+#include <clc/opencl/math/fma.h>
+#include <clc/opencl/math/fmax.h>
+#include <clc/opencl/math/fmin.h>
+#include <clc/opencl/math/fmod.h>
+#include <clc/opencl/math/fract.h>
+#include <clc/opencl/math/frexp.h>
+#include <clc/opencl/math/half_cos.h>
+#include <clc/opencl/math/half_divide.h>
+#include <clc/opencl/math/half_exp.h>
+#include <clc/opencl/math/half_exp10.h>
+#include <clc/opencl/math/half_exp2.h>
+#include <clc/opencl/math/half_log.h>
+#include <clc/opencl/math/half_log10.h>
+#include <clc/opencl/math/half_log2.h>
+#include <clc/opencl/math/half_powr.h>
+#include <clc/opencl/math/half_recip.h>
+#include <clc/opencl/math/half_rsqrt.h>
+#include <clc/opencl/math/half_sin.h>
+#include <clc/opencl/math/half_sqrt.h>
+#include <clc/opencl/math/half_tan.h>
+#include <clc/opencl/math/hypot.h>
+#include <clc/opencl/math/ilogb.h>
+#include <clc/opencl/math/ldexp.h>
+#include <clc/opencl/math/lgamma.h>
+#include <clc/opencl/math/lgamma_r.h>
+#include <clc/opencl/math/log.h>
+#include <clc/opencl/math/log10.h>
+#include <clc/opencl/math/log1p.h>
+#include <clc/opencl/math/log2.h>
+#include <clc/opencl/math/logb.h>
+#include <clc/opencl/math/mad.h>
+#include <clc/opencl/math/maxmag.h>
+#include <clc/opencl/math/minmag.h>
+#include <clc/opencl/math/modf.h>
+#include <clc/opencl/math/nan.h>
+#include <clc/opencl/math/nextafter.h>
+#include <clc/opencl/math/pow.h>
+#include <clc/opencl/math/pown.h>
+#include <clc/opencl/math/powr.h>
+#include <clc/opencl/math/remainder.h>
+#include <clc/opencl/math/remquo.h>
+#include <clc/opencl/math/rint.h>
+#include <clc/opencl/math/rootn.h>
+#include <clc/opencl/math/round.h>
+#include <clc/opencl/math/sin.h>
+#include <clc/opencl/math/sincos.h>
+#include <clc/opencl/math/sinh.h>
+#include <clc/opencl/math/sinpi.h>
+#include <clc/opencl/math/sqrt.h>
+#include <clc/opencl/math/tan.h>
+#include <clc/opencl/math/tanh.h>
+#include <clc/opencl/math/tanpi.h>
+#include <clc/opencl/math/tgamma.h>
+#include <clc/opencl/math/trunc.h>
+#include <clc/opencl/math/native_cos.h>
+#include <clc/opencl/math/native_divide.h>
+#include <clc/opencl/math/native_exp.h>
+#include <clc/opencl/math/native_exp10.h>
+#include <clc/opencl/math/native_exp2.h>
+#include <clc/opencl/math/native_log.h>
+#include <clc/opencl/math/native_log10.h>
+#include <clc/opencl/math/native_log2.h>
+#include <clc/opencl/math/native_powr.h>
+#include <clc/opencl/math/native_recip.h>
+#include <clc/opencl/math/native_sin.h>
+#include <clc/opencl/math/native_sqrt.h>
+#include <clc/opencl/math/native_rsqrt.h>
+#include <clc/opencl/math/native_tan.h>
+#include <clc/opencl/math/rsqrt.h>
+
+/* 6.11.2.1 Floating-point macros */
+#include <clc/float/definitions.h>
+
+/* 6.11.3 Integer Functions */
+#include <clc/opencl/integer/abs.h>
+#include <clc/opencl/integer/abs_diff.h>
+#include <clc/opencl/integer/add_sat.h>
+#include <clc/opencl/integer/clz.h>
+#include <clc/opencl/integer/ctz.h>
+#include <clc/opencl/integer/hadd.h>
+#include <clc/opencl/integer/mad24.h>
+#include <clc/opencl/integer/mad_hi.h>
+#include <clc/opencl/integer/mad_sat.h>
+#include <clc/opencl/integer/mul24.h>
+#include <clc/opencl/integer/mul_hi.h>
+#include <clc/opencl/integer/popcount.h>
+#include <clc/opencl/integer/rhadd.h>
+#include <clc/opencl/integer/rotate.h>
+#include <clc/opencl/integer/sub_sat.h>
+#include <clc/opencl/integer/upsample.h>
+
+/* 6.11.3 Integer Definitions */
+#include <clc/integer/definitions.h>
+
+/* 6.11.2 and 6.11.3 Shared Integer/Math Functions */
+#include <clc/opencl/shared/clamp.h>
+#include <clc/opencl/shared/max.h>
+#include <clc/opencl/shared/min.h>
+#include <clc/opencl/shared/vload.h>
+#include <clc/opencl/shared/vstore.h>
+
+/* 6.11.4 Common Functions */
+#include <clc/opencl/common/degrees.h>
+#include <clc/opencl/common/radians.h>
+#include <clc/opencl/common/mix.h>
+#include <clc/opencl/common/sign.h>
+#include <clc/opencl/common/smoothstep.h>
+#include <clc/opencl/common/step.h>
+
+/* 6.11.5 Geometric Functions */
+#include <clc/opencl/geometric/cross.h>
+#include <clc/opencl/geometric/distance.h>
+#include <clc/opencl/geometric/dot.h>
+#include <clc/opencl/geometric/fast_distance.h>
+#include <clc/opencl/geometric/fast_length.h>
+#include <clc/opencl/geometric/fast_normalize.h>
+#include <clc/opencl/geometric/length.h>
+#include <clc/opencl/geometric/normalize.h>
+
+/* 6.11.6 Relational Functions */
+#include <clc/opencl/relational/all.h>
+#include <clc/opencl/relational/any.h>
+#include <clc/opencl/relational/bitselect.h>
+#include <clc/opencl/relational/isequal.h>
+#include <clc/opencl/relational/isfinite.h>
+#include <clc/opencl/relational/isgreater.h>
+#include <clc/opencl/relational/isgreaterequal.h>
+#include <clc/opencl/relational/isinf.h>
+#include <clc/opencl/relational/isless.h>
+#include <clc/opencl/relational/islessequal.h>
+#include <clc/opencl/relational/islessgreater.h>
+#include <clc/opencl/relational/isnan.h>
+#include <clc/opencl/relational/isnormal.h>
+#include <clc/opencl/relational/isnotequal.h>
+#include <clc/opencl/relational/isordered.h>
+#include <clc/opencl/relational/isunordered.h>
+#include <clc/opencl/relational/select.h>
+#include <clc/opencl/relational/signbit.h>
+
+/* 6.11.8 Synchronization Functions */
+#include <clc/opencl/synchronization/cl_mem_fence_flags.h>
+#include <clc/opencl/synchronization/barrier.h>
+
+/* 6.11.9 Explicit Memory Fence Functions */
+#include <clc/opencl/explicit_fence/explicit_memory_fence.h>
+
+/* 6.11.10 Async Copy and Prefetch Functions */
+#include <clc/opencl/async/async_work_group_copy.h>
+#include <clc/opencl/async/async_work_group_strided_copy.h>
+#include <clc/opencl/async/prefetch.h>
+#include <clc/opencl/async/wait_group_events.h>
+
+/* 6.11.11 Atomic Functions */
+#include <clc/opencl/atomic/atomic_add.h>
+#include <clc/opencl/atomic/atomic_and.h>
+#include <clc/opencl/atomic/atomic_cmpxchg.h>
+#include <clc/opencl/atomic/atomic_dec.h>
+#include <clc/opencl/atomic/atomic_inc.h>
+#include <clc/opencl/atomic/atomic_max.h>
+#include <clc/opencl/atomic/atomic_min.h>
+#include <clc/opencl/atomic/atomic_or.h>
+#include <clc/opencl/atomic/atomic_sub.h>
+#include <clc/opencl/atomic/atomic_xchg.h>
+#include <clc/opencl/atomic/atomic_xor.h>
+
+/* cl_khr_global_int32_base_atomics, cl_khr_local_int32_base_atomics and
+ * cl_khr_int64_base_atomics Extension Functions */
+#include <clc/opencl/atomic/atom_add.h>
+#include <clc/opencl/atomic/atom_cmpxchg.h>
+#include <clc/opencl/atomic/atom_dec.h>
+#include <clc/opencl/atomic/atom_inc.h>
+#include <clc/opencl/atomic/atom_sub.h>
+#include <clc/opencl/atomic/atom_xchg.h>
+
+/* cl_khr_global_int32_extended_atomics, cl_khr_local_int32_extended_atomics and
+ * cl_khr_int64_extended_atomics Extension Functions */
+#include <clc/opencl/atomic/atom_and.h>
+#include <clc/opencl/atomic/atom_max.h>
+#include <clc/opencl/atomic/atom_min.h>
+#include <clc/opencl/atomic/atom_or.h>
+#include <clc/opencl/atomic/atom_xor.h>
+
+/* 6.12.12 Miscellaneous Vector Functions */
+#include <clc/opencl/misc/shuffle.h>
+#include <clc/opencl/misc/shuffle2.h>
+
+/* 6.11.13 Image Read and Write Functions */
+#include <clc/opencl/image/image_defines.h>
+#include <clc/opencl/image/image.h>
+
+#pragma OPENCL EXTENSION all : disable
+
+#endif // __CLC_OPENCL_CLC_H__
diff --git a/libclc/generic/include/clc/common/degrees.h b/libclc/opencl/include/clc/opencl/common/degrees.h
similarity index 80%
rename from libclc/generic/include/clc/common/degrees.h
rename to libclc/opencl/include/clc/opencl/common/degrees.h
index b895a4cbeeeb7..f442c5fbda857 100644
--- a/libclc/generic/include/clc/common/degrees.h
+++ b/libclc/opencl/include/clc/opencl/common/degrees.h
@@ -6,5 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/common/degrees.inc>
+#define __CLC_FUNCTION degrees
+#define __CLC_BODY <clc/math/unary_decl.inc>
+
 #include <clc/math/gentype.inc>
+
+#undef __CLC_FUNCTION
diff --git a/libclc/generic/include/clc/common/mix.h b/libclc/opencl/include/clc/opencl/common/mix.h
similarity index 89%
rename from libclc/generic/include/clc/common/mix.h
rename to libclc/opencl/include/clc/opencl/common/mix.h
index 51504282c1ae4..76aeaaba665ac 100644
--- a/libclc/generic/include/clc/common/mix.h
+++ b/libclc/opencl/include/clc/opencl/common/mix.h
@@ -6,5 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/common/mix.inc>
+#define __CLC_BODY <clc/opencl/common/mix.inc>
 #include <clc/math/gentype.inc>
diff --git a/libclc/generic/include/clc/common/mix.inc b/libclc/opencl/include/clc/opencl/common/mix.inc
similarity index 100%
rename from libclc/generic/include/clc/common/mix.inc
rename to libclc/opencl/include/clc/opencl/common/mix.inc
diff --git a/libclc/generic/include/clc/common/radians.h b/libclc/opencl/include/clc/opencl/common/radians.h
similarity index 80%
rename from libclc/generic/include/clc/common/radians.h
rename to libclc/opencl/include/clc/opencl/common/radians.h
index f683e97778f28..2772f7c2f0ae8 100644
--- a/libclc/generic/include/clc/common/radians.h
+++ b/libclc/opencl/include/clc/opencl/common/radians.h
@@ -6,5 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/common/radians.inc>
+#define __CLC_FUNCTION radians
+#define __CLC_BODY <clc/math/unary_decl.inc>
+
 #include <clc/math/gentype.inc>
+
+#undef __CLC_FUNCTION
diff --git a/libclc/generic/include/clc/common/sign.h b/libclc/opencl/include/clc/opencl/common/sign.h
similarity index 100%
rename from libclc/generic/include/clc/common/sign.h
rename to libclc/opencl/include/clc/opencl/common/sign.h
diff --git a/libclc/generic/include/clc/common/smoothstep.h b/libclc/opencl/include/clc/opencl/common/smoothstep.h
similarity index 88%
rename from libclc/generic/include/clc/common/smoothstep.h
rename to libclc/opencl/include/clc/opencl/common/smoothstep.h
index 05c3a51ccddb1..87a642f8947a1 100644
--- a/libclc/generic/include/clc/common/smoothstep.h
+++ b/libclc/opencl/include/clc/opencl/common/smoothstep.h
@@ -6,5 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/common/smoothstep.inc>
+#define __CLC_BODY <clc/opencl/common/smoothstep.inc>
 #include <clc/math/gentype.inc>
diff --git a/libclc/generic/include/clc/common/smoothstep.inc b/libclc/opencl/include/clc/opencl/common/smoothstep.inc
similarity index 100%
rename from libclc/generic/include/clc/common/smoothstep.inc
rename to libclc/opencl/include/clc/opencl/common/smoothstep.inc
diff --git a/libclc/generic/include/clc/common/step.h b/libclc/opencl/include/clc/opencl/common/step.h
similarity index 89%
rename from libclc/generic/include/clc/common/step.h
rename to libclc/opencl/include/clc/opencl/common/step.h
index 8c663c981975d..d25a66f16ac3a 100644
--- a/libclc/generic/include/clc/common/step.h
+++ b/libclc/opencl/include/clc/opencl/common/step.h
@@ -6,5 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/common/step.inc>
+#define __CLC_BODY <clc/opencl/common/step.inc>
 #include <clc/math/gentype.inc>
diff --git a/libclc/generic/include/clc/common/step.inc b/libclc/opencl/include/clc/opencl/common/step.inc
similarity index 100%
rename from libclc/generic/include/clc/common/step.inc
rename to libclc/opencl/include/clc/opencl/common/step.inc
diff --git a/libclc/generic/include/clc/convert.h b/libclc/opencl/include/clc/opencl/convert.h
similarity index 100%
rename from libclc/generic/include/clc/convert.h
rename to libclc/opencl/include/clc/opencl/convert.h
diff --git a/libclc/generic/include/clc/explicit_fence/explicit_memory_fence.h b/libclc/opencl/include/clc/opencl/explicit_fence/explicit_memory_fence.h
similarity index 100%
rename from libclc/generic/include/clc/explicit_fence/explicit_memory_fence.h
rename to libclc/opencl/include/clc/opencl/explicit_fence/explicit_memory_fence.h
diff --git a/libclc/generic/include/clc/geometric/cross.h b/libclc/opencl/include/clc/opencl/geometric/cross.h
similarity index 100%
rename from libclc/generic/include/clc/geometric/cross.h
rename to libclc/opencl/include/clc/opencl/geometric/cross.h
diff --git a/libclc/generic/include/clc/geometric/distance.h b/libclc/opencl/include/clc/opencl/geometric/distance.h
similarity index 100%
rename from libclc/generic/include/clc/geometric/distance.h
rename to libclc/opencl/include/clc/opencl/geometric/distance.h
diff --git a/libclc/generic/include/clc/geometric/dot.h b/libclc/opencl/include/clc/opencl/geometric/dot.h
similarity index 100%
rename from libclc/generic/include/clc/geometric/dot.h
rename to libclc/opencl/include/clc/opencl/geometric/dot.h
diff --git a/libclc/generic/include/clc/geometric/fast_distance.h b/libclc/opencl/include/clc/opencl/geometric/fast_distance.h
similarity index 100%
rename from libclc/generic/include/clc/geometric/fast_distance.h
rename to libclc/opencl/include/clc/opencl/geometric/fast_distance.h
diff --git a/libclc/generic/include/clc/geometric/fast_length.h b/libclc/opencl/include/clc/opencl/geometric/fast_length.h
similarity index 100%
rename from libclc/generic/include/clc/geometric/fast_length.h
rename to libclc/opencl/include/clc/opencl/geometric/fast_length.h
diff --git a/libclc/generic/include/clc/geometric/fast_normalize.h b/libclc/opencl/include/clc/opencl/geometric/fast_normalize.h
similarity index 100%
rename from libclc/generic/include/clc/geometric/fast_normalize.h
rename to libclc/opencl/include/clc/opencl/geometric/fast_normalize.h
diff --git a/libclc/generic/include/clc/geometric/length.h b/libclc/opencl/include/clc/opencl/geometric/length.h
similarity index 100%
rename from libclc/generic/include/clc/geometric/length.h
rename to libclc/opencl/include/clc/opencl/geometric/length.h
diff --git a/libclc/generic/include/clc/geometric/normalize.h b/libclc/opencl/include/clc/opencl/geometric/normalize.h
similarity index 100%
rename from libclc/generic/include/clc/geometric/normalize.h
rename to libclc/opencl/include/clc/opencl/geometric/normalize.h
diff --git a/libclc/generic/include/clc/image/image.h b/libclc/opencl/include/clc/opencl/image/image.h
similarity index 100%
rename from libclc/generic/include/clc/image/image.h
rename to libclc/opencl/include/clc/opencl/image/image.h
diff --git a/libclc/generic/include/clc/image/image_defines.h b/libclc/opencl/include/clc/opencl/image/image_defines.h
similarity index 100%
rename from libclc/generic/include/clc/image/image_defines.h
rename to libclc/opencl/include/clc/opencl/image/image_defines.h
diff --git a/libclc/generic/include/clc/integer/abs.h b/libclc/opencl/include/clc/opencl/integer/abs.h
similarity index 89%
rename from libclc/generic/include/clc/integer/abs.h
rename to libclc/opencl/include/clc/opencl/integer/abs.h
index df5e23e08d8c6..22ba40fb40d42 100644
--- a/libclc/generic/include/clc/integer/abs.h
+++ b/libclc/opencl/include/clc/opencl/integer/abs.h
@@ -6,5 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/integer/abs.inc>
+#define __CLC_BODY <clc/opencl/integer/abs.inc>
 #include <clc/integer/gentype.inc>
diff --git a/libclc/generic/include/clc/integer/abs.inc b/libclc/opencl/include/clc/opencl/integer/abs.inc
similarity index 100%
rename from libclc/generic/include/clc/integer/abs.inc
rename to libclc/opencl/include/clc/opencl/integer/abs.inc
diff --git a/libclc/generic/include/clc/integer/abs_diff.h b/libclc/opencl/include/clc/opencl/integer/abs_diff.h
similarity index 88%
rename from libclc/generic/include/clc/integer/abs_diff.h
rename to libclc/opencl/include/clc/opencl/integer/abs_diff.h
index 0005e0da7645e..f22cc4d88afcf 100644
--- a/libclc/generic/include/clc/integer/abs_diff.h
+++ b/libclc/opencl/include/clc/opencl/integer/abs_diff.h
@@ -6,5 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/integer/abs_diff.inc>
+#define __CLC_BODY <clc/opencl/integer/abs_diff.inc>
 #include <clc/integer/gentype.inc>
diff --git a/libclc/generic/include/clc/integer/abs_diff.inc b/libclc/opencl/include/clc/opencl/integer/abs_diff.inc
similarity index 100%
rename from libclc/generic/include/clc/integer/abs_diff.inc
rename to libclc/opencl/include/clc/opencl/integer/abs_diff.inc
diff --git a/libclc/generic/include/clc/integer/add_sat.h b/libclc/opencl/include/clc/opencl/integer/add_sat.h
similarity index 79%
rename from libclc/generic/include/clc/integer/add_sat.h
rename to libclc/opencl/include/clc/opencl/integer/add_sat.h
index 9ef8affd9fc62..1982d11908008 100644
--- a/libclc/generic/include/clc/integer/add_sat.h
+++ b/libclc/opencl/include/clc/opencl/integer/add_sat.h
@@ -6,5 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/integer/add_sat.inc>
+#define __CLC_FUNCTION add_sat
+#define __CLC_BODY <clc/shared/binary_decl.inc>
+
 #include <clc/integer/gentype.inc>
+
+#undef __CLC_FUNCTION
diff --git a/libclc/generic/include/clc/integer/clz.h b/libclc/opencl/include/clc/opencl/integer/clz.h
similarity index 100%
rename from libclc/generic/include/clc/integer/clz.h
rename to libclc/opencl/include/clc/opencl/integer/clz.h
diff --git a/libclc/generic/include/clc/integer/ctz.h b/libclc/opencl/include/clc/opencl/integer/ctz.h
similarity index 100%
rename from libclc/generic/include/clc/integer/ctz.h
rename to libclc/opencl/include/clc/opencl/integer/ctz.h
diff --git a/libclc/generic/include/clc/integer/hadd.h b/libclc/opencl/include/clc/opencl/integer/hadd.h
similarity index 100%
rename from libclc/generic/include/clc/integer/hadd.h
rename to libclc/opencl/include/clc/opencl/integer/hadd.h
diff --git a/libclc/generic/include/clc/integer/mad24.h b/libclc/opencl/include/clc/opencl/integer/mad24.h
similarity index 100%
rename from libclc/generic/include/clc/integer/mad24.h
rename to libclc/opencl/include/clc/opencl/integer/mad24.h
diff --git a/libclc/generic/include/clc/integer/mad_hi.h b/libclc/opencl/include/clc/opencl/integer/mad_hi.h
similarity index 100%
rename from libclc/generic/include/clc/integer/mad_hi.h
rename to libclc/opencl/include/clc/opencl/integer/mad_hi.h
diff --git a/libclc/generic/include/clc/integer/mad_sat.h b/libclc/opencl/include/clc/opencl/integer/mad_sat.h
similarity index 79%
rename from libclc/generic/include/clc/integer/mad_sat.h
rename to libclc/opencl/include/clc/opencl/integer/mad_sat.h
index e404b6438dfbc..0a9fd7869a6f4 100644
--- a/libclc/generic/include/clc/integer/mad_sat.h
+++ b/libclc/opencl/include/clc/opencl/integer/mad_sat.h
@@ -6,5 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/integer/mad_sat.inc>
+#define __CLC_FUNCTION mad_sat
+#define __CLC_BODY <clc/shared/ternary_decl.inc>
+
 #include <clc/integer/gentype.inc>
+
+#undef __CLC_FUNCTION
diff --git a/libclc/generic/include/clc/integer/mul24.h b/libclc/opencl/include/clc/opencl/integer/mul24.h
similarity index 100%
rename from libclc/generic/include/clc/integer/mul24.h
rename to libclc/opencl/include/clc/opencl/integer/mul24.h
diff --git a/libclc/generic/include/clc/integer/mul_hi.h b/libclc/opencl/include/clc/opencl/integer/mul_hi.h
similarity index 100%
rename from libclc/generic/include/clc/integer/mul_hi.h
rename to libclc/opencl/include/clc/opencl/integer/mul_hi.h
diff --git a/libclc/generic/include/clc/integer/popcount.h b/libclc/opencl/include/clc/opencl/integer/popcount.h
similarity index 100%
rename from libclc/generic/include/clc/integer/popcount.h
rename to libclc/opencl/include/clc/opencl/integer/popcount.h
diff --git a/libclc/generic/include/clc/integer/rhadd.h b/libclc/opencl/include/clc/opencl/integer/rhadd.h
similarity index 100%
rename from libclc/generic/include/clc/integer/rhadd.h
rename to libclc/opencl/include/clc/opencl/integer/rhadd.h
diff --git a/libclc/generic/include/clc/integer/rotate.h b/libclc/opencl/include/clc/opencl/integer/rotate.h
similarity index 79%
rename from libclc/generic/include/clc/integer/rotate.h
rename to libclc/opencl/include/clc/opencl/integer/rotate.h
index 9209f6e6ab320..1e4de24cbf313 100644
--- a/libclc/generic/include/clc/integer/rotate.h
+++ b/libclc/opencl/include/clc/opencl/integer/rotate.h
@@ -6,5 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/integer/rotate.inc>
+#define __CLC_FUNCTION rotate
+#define __CLC_BODY <clc/shared/binary_decl.inc>
+
 #include <clc/integer/gentype.inc>
+
+#undef __CLC_FUNCTION
diff --git a/libclc/generic/include/clc/integer/sub_sat.h b/libclc/opencl/include/clc/opencl/integer/sub_sat.h
similarity index 79%
rename from libclc/generic/include/clc/integer/sub_sat.h
rename to libclc/opencl/include/clc/opencl/integer/sub_sat.h
index 6a30bd110ae71..ee5d8c78f3ebe 100644
--- a/libclc/generic/include/clc/integer/sub_sat.h
+++ b/libclc/opencl/include/clc/opencl/integer/sub_sat.h
@@ -6,5 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/integer/sub_sat.inc>
+#define __CLC_FUNCTION sub_sat
+#define __CLC_BODY <clc/shared/binary_decl.inc>
+
 #include <clc/integer/gentype.inc>
+
+#undef __CLC_FUNCTION
diff --git a/libclc/generic/include/clc/integer/upsample.h b/libclc/opencl/include/clc/opencl/integer/upsample.h
similarity index 100%
rename from libclc/generic/include/clc/integer/upsample.h
rename to libclc/opencl/include/clc/opencl/integer/upsample.h
diff --git a/libclc/generic/include/clc/math/acos.h b/libclc/opencl/include/clc/opencl/math/acos.h
similarity index 100%
rename from libclc/generic/include/clc/math/acos.h
rename to libclc/opencl/include/clc/opencl/math/acos.h
diff --git a/libclc/generic/include/clc/math/acosh.h b/libclc/opencl/include/clc/opencl/math/acosh.h
similarity index 100%
rename from libclc/generic/include/clc/math/acosh.h
rename to libclc/opencl/include/clc/opencl/math/acosh.h
diff --git a/libclc/generic/include/clc/math/acospi.h b/libclc/opencl/include/clc/opencl/math/acospi.h
similarity index 100%
rename from libclc/generic/include/clc/math/acospi.h
rename to libclc/opencl/include/clc/opencl/math/acospi.h
diff --git a/libclc/generic/include/clc/math/asin.h b/libclc/opencl/include/clc/opencl/math/asin.h
similarity index 100%
rename from libclc/generic/include/clc/math/asin.h
rename to libclc/opencl/include/clc/opencl/math/asin.h
diff --git a/libclc/generic/include/clc/math/asinh.h b/libclc/opencl/include/clc/opencl/math/asinh.h
similarity index 100%
rename from libclc/generic/include/clc/math/asinh.h
rename to libclc/opencl/include/clc/opencl/math/asinh.h
diff --git a/libclc/generic/include/clc/math/asinpi.h b/libclc/opencl/include/clc/opencl/math/asinpi.h
similarity index 100%
rename from libclc/generic/include/clc/math/asinpi.h
rename to libclc/opencl/include/clc/opencl/math/asinpi.h
diff --git a/libclc/generic/include/clc/math/atan.h b/libclc/opencl/include/clc/opencl/math/atan.h
similarity index 100%
rename from libclc/generic/include/clc/math/atan.h
rename to libclc/opencl/include/clc/opencl/math/atan.h
diff --git a/libclc/generic/include/clc/math/atan2.h b/libclc/opencl/include/clc/opencl/math/atan2.h
similarity index 100%
rename from libclc/generic/include/clc/math/atan2.h
rename to libclc/opencl/include/clc/opencl/math/atan2.h
diff --git a/libclc/generic/include/clc/math/atan2pi.h b/libclc/opencl/include/clc/opencl/math/atan2pi.h
similarity index 100%
rename from libclc/generic/include/clc/math/atan2pi.h
rename to libclc/opencl/include/clc/opencl/math/atan2pi.h
diff --git a/libclc/generic/include/clc/math/atanh.h b/libclc/opencl/include/clc/opencl/math/atanh.h
similarity index 100%
rename from libclc/generic/include/clc/math/atanh.h
rename to libclc/opencl/include/clc/opencl/math/atanh.h
diff --git a/libclc/generic/include/clc/math/atanpi.h b/libclc/opencl/include/clc/opencl/math/atanpi.h
similarity index 100%
rename from libclc/generic/include/clc/math/atanpi.h
rename to libclc/opencl/include/clc/opencl/math/atanpi.h
diff --git a/libclc/generic/include/clc/math/cbrt.h b/libclc/opencl/include/clc/opencl/math/cbrt.h
similarity index 100%
rename from libclc/generic/include/clc/math/cbrt.h
rename to libclc/opencl/include/clc/opencl/math/cbrt.h
diff --git a/libclc/generic/include/clc/math/ceil.h b/libclc/opencl/include/clc/opencl/math/ceil.h
similarity index 100%
rename from libclc/generic/include/clc/math/ceil.h
rename to libclc/opencl/include/clc/opencl/math/ceil.h
diff --git a/libclc/generic/include/clc/math/copysign.h b/libclc/opencl/include/clc/opencl/math/copysign.h
similarity index 100%
rename from libclc/generic/include/clc/math/copysign.h
rename to libclc/opencl/include/clc/opencl/math/copysign.h
diff --git a/libclc/generic/include/clc/math/cos.h b/libclc/opencl/include/clc/opencl/math/cos.h
similarity index 100%
rename from libclc/generic/include/clc/math/cos.h
rename to libclc/opencl/include/clc/opencl/math/cos.h
diff --git a/libclc/generic/include/clc/math/cosh.h b/libclc/opencl/include/clc/opencl/math/cosh.h
similarity index 100%
rename from libclc/generic/include/clc/math/cosh.h
rename to libclc/opencl/include/clc/opencl/math/cosh.h
diff --git a/libclc/generic/include/clc/math/cospi.h b/libclc/opencl/include/clc/opencl/math/cospi.h
similarity index 100%
rename from libclc/generic/include/clc/math/cospi.h
rename to libclc/opencl/include/clc/opencl/math/cospi.h
diff --git a/libclc/generic/include/clc/math/erf.h b/libclc/opencl/include/clc/opencl/math/erf.h
similarity index 100%
rename from libclc/generic/include/clc/math/erf.h
rename to libclc/opencl/include/clc/opencl/math/erf.h
diff --git a/libclc/generic/include/clc/math/erfc.h b/libclc/opencl/include/clc/opencl/math/erfc.h
similarity index 100%
rename from libclc/generic/include/clc/math/erfc.h
rename to libclc/opencl/include/clc/opencl/math/erfc.h
diff --git a/libclc/generic/include/clc/math/exp.h b/libclc/opencl/include/clc/opencl/math/exp.h
similarity index 100%
rename from libclc/generic/include/clc/math/exp.h
rename to libclc/opencl/include/clc/opencl/math/exp.h
diff --git a/libclc/generic/include/clc/math/exp10.h b/libclc/opencl/include/clc/opencl/math/exp10.h
similarity index 100%
rename from libclc/generic/include/clc/math/exp10.h
rename to libclc/opencl/include/clc/opencl/math/exp10.h
diff --git a/libclc/generic/include/clc/math/exp2.h b/libclc/opencl/include/clc/opencl/math/exp2.h
similarity index 100%
rename from libclc/generic/include/clc/math/exp2.h
rename to libclc/opencl/include/clc/opencl/math/exp2.h
diff --git a/libclc/generic/include/clc/math/expm1.h b/libclc/opencl/include/clc/opencl/math/expm1.h
similarity index 100%
rename from libclc/generic/include/clc/math/expm1.h
rename to libclc/opencl/include/clc/opencl/math/expm1.h
diff --git a/libclc/generic/include/clc/math/fabs.h b/libclc/opencl/include/clc/opencl/math/fabs.h
similarity index 100%
rename from libclc/generic/include/clc/math/fabs.h
rename to libclc/opencl/include/clc/opencl/math/fabs.h
diff --git a/libclc/generic/include/clc/math/fdim.h b/libclc/opencl/include/clc/opencl/math/fdim.h
similarity index 100%
rename from libclc/generic/include/clc/math/fdim.h
rename to libclc/opencl/include/clc/opencl/math/fdim.h
diff --git a/libclc/generic/include/clc/math/floor.h b/libclc/opencl/include/clc/opencl/math/floor.h
similarity index 100%
rename from libclc/generic/include/clc/math/floor.h
rename to libclc/opencl/include/clc/opencl/math/floor.h
diff --git a/libclc/generic/include/clc/math/fma.h b/libclc/opencl/include/clc/opencl/math/fma.h
similarity index 100%
rename from libclc/generic/include/clc/math/fma.h
rename to libclc/opencl/include/clc/opencl/math/fma.h
diff --git a/libclc/generic/include/clc/math/fmax.h b/libclc/opencl/include/clc/opencl/math/fmax.h
similarity index 100%
rename from libclc/generic/include/clc/math/fmax.h
rename to libclc/opencl/include/clc/opencl/math/fmax.h
diff --git a/libclc/generic/include/clc/math/fmin.h b/libclc/opencl/include/clc/opencl/math/fmin.h
similarity index 100%
rename from libclc/generic/include/clc/math/fmin.h
rename to libclc/opencl/include/clc/opencl/math/fmin.h
diff --git a/libclc/generic/include/clc/math/fmod.h b/libclc/opencl/include/clc/opencl/math/fmod.h
similarity index 100%
rename from libclc/generic/include/clc/math/fmod.h
rename to libclc/opencl/include/clc/opencl/math/fmod.h
diff --git a/libclc/generic/include/clc/math/fract.h b/libclc/opencl/include/clc/opencl/math/fract.h
similarity index 100%
rename from libclc/generic/include/clc/math/fract.h
rename to libclc/opencl/include/clc/opencl/math/fract.h
diff --git a/libclc/generic/include/clc/math/frexp.h b/libclc/opencl/include/clc/opencl/math/frexp.h
similarity index 89%
rename from libclc/generic/include/clc/math/frexp.h
rename to libclc/opencl/include/clc/opencl/math/frexp.h
index d62d92bd8fa96..a03aefbf60899 100644
--- a/libclc/generic/include/clc/math/frexp.h
+++ b/libclc/opencl/include/clc/opencl/math/frexp.h
@@ -6,5 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/math/frexp.inc>
+#define __CLC_BODY <clc/opencl/math/frexp.inc>
 #include <clc/math/gentype.inc>
diff --git a/libclc/generic/include/clc/math/frexp.inc b/libclc/opencl/include/clc/opencl/math/frexp.inc
similarity index 100%
rename from libclc/generic/include/clc/math/frexp.inc
rename to libclc/opencl/include/clc/opencl/math/frexp.inc
diff --git a/libclc/generic/include/clc/math/half_cos.h b/libclc/opencl/include/clc/opencl/math/half_cos.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_cos.h
rename to libclc/opencl/include/clc/opencl/math/half_cos.h
diff --git a/libclc/generic/include/clc/math/half_divide.h b/libclc/opencl/include/clc/opencl/math/half_divide.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_divide.h
rename to libclc/opencl/include/clc/opencl/math/half_divide.h
diff --git a/libclc/generic/include/clc/math/half_exp.h b/libclc/opencl/include/clc/opencl/math/half_exp.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_exp.h
rename to libclc/opencl/include/clc/opencl/math/half_exp.h
diff --git a/libclc/generic/include/clc/math/half_exp10.h b/libclc/opencl/include/clc/opencl/math/half_exp10.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_exp10.h
rename to libclc/opencl/include/clc/opencl/math/half_exp10.h
diff --git a/libclc/generic/include/clc/math/half_exp2.h b/libclc/opencl/include/clc/opencl/math/half_exp2.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_exp2.h
rename to libclc/opencl/include/clc/opencl/math/half_exp2.h
diff --git a/libclc/generic/include/clc/math/half_log.h b/libclc/opencl/include/clc/opencl/math/half_log.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_log.h
rename to libclc/opencl/include/clc/opencl/math/half_log.h
diff --git a/libclc/generic/include/clc/math/half_log10.h b/libclc/opencl/include/clc/opencl/math/half_log10.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_log10.h
rename to libclc/opencl/include/clc/opencl/math/half_log10.h
diff --git a/libclc/generic/include/clc/math/half_log2.h b/libclc/opencl/include/clc/opencl/math/half_log2.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_log2.h
rename to libclc/opencl/include/clc/opencl/math/half_log2.h
diff --git a/libclc/generic/include/clc/math/half_powr.h b/libclc/opencl/include/clc/opencl/math/half_powr.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_powr.h
rename to libclc/opencl/include/clc/opencl/math/half_powr.h
diff --git a/libclc/generic/include/clc/math/half_recip.h b/libclc/opencl/include/clc/opencl/math/half_recip.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_recip.h
rename to libclc/opencl/include/clc/opencl/math/half_recip.h
diff --git a/libclc/generic/include/clc/math/half_rsqrt.h b/libclc/opencl/include/clc/opencl/math/half_rsqrt.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_rsqrt.h
rename to libclc/opencl/include/clc/opencl/math/half_rsqrt.h
diff --git a/libclc/generic/include/clc/math/half_sin.h b/libclc/opencl/include/clc/opencl/math/half_sin.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_sin.h
rename to libclc/opencl/include/clc/opencl/math/half_sin.h
diff --git a/libclc/generic/include/clc/math/half_sqrt.h b/libclc/opencl/include/clc/opencl/math/half_sqrt.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_sqrt.h
rename to libclc/opencl/include/clc/opencl/math/half_sqrt.h
diff --git a/libclc/generic/include/clc/math/half_tan.h b/libclc/opencl/include/clc/opencl/math/half_tan.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_tan.h
rename to libclc/opencl/include/clc/opencl/math/half_tan.h
diff --git a/libclc/generic/include/clc/math/hypot.h b/libclc/opencl/include/clc/opencl/math/hypot.h
similarity index 100%
rename from libclc/generic/include/clc/math/hypot.h
rename to libclc/opencl/include/clc/opencl/math/hypot.h
diff --git a/libclc/generic/include/clc/math/ilogb.h b/libclc/opencl/include/clc/opencl/math/ilogb.h
similarity index 100%
rename from libclc/generic/include/clc/math/ilogb.h
rename to libclc/opencl/include/clc/opencl/math/ilogb.h
diff --git a/libclc/generic/include/clc/math/ldexp.h b/libclc/opencl/include/clc/opencl/math/ldexp.h
similarity index 89%
rename from libclc/generic/include/clc/math/ldexp.h
rename to libclc/opencl/include/clc/opencl/math/ldexp.h
index 804b4edd67c3b..6dcd2a9548d09 100644
--- a/libclc/generic/include/clc/math/ldexp.h
+++ b/libclc/opencl/include/clc/opencl/math/ldexp.h
@@ -6,5 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/math/ldexp.inc>
+#define __CLC_BODY <clc/opencl/math/ldexp.inc>
 #include <clc/math/gentype.inc>
diff --git a/libclc/generic/include/clc/math/ldexp.inc b/libclc/opencl/include/clc/opencl/math/ldexp.inc
similarity index 100%
rename from libclc/generic/include/clc/math/ldexp.inc
rename to libclc/opencl/include/clc/opencl/math/ldexp.inc
diff --git a/libclc/generic/include/clc/math/lgamma.h b/libclc/opencl/include/clc/opencl/math/lgamma.h
similarity index 100%
rename from libclc/generic/include/clc/math/lgamma.h
rename to libclc/opencl/include/clc/opencl/math/lgamma.h
diff --git a/libclc/generic/include/clc/math/lgamma_r.h b/libclc/opencl/include/clc/opencl/math/lgamma_r.h
similarity index 100%
rename from libclc/generic/include/clc/math/lgamma_r.h
rename to libclc/opencl/include/clc/opencl/math/lgamma_r.h
diff --git a/libclc/generic/include/clc/math/log.h b/libclc/opencl/include/clc/opencl/math/log.h
similarity index 100%
rename from libclc/generic/include/clc/math/log.h
rename to libclc/opencl/include/clc/opencl/math/log.h
diff --git a/libclc/generic/include/clc/math/log10.h b/libclc/opencl/include/clc/opencl/math/log10.h
similarity index 100%
rename from libclc/generic/include/clc/math/log10.h
rename to libclc/opencl/include/clc/opencl/math/log10.h
diff --git a/libclc/generic/include/clc/math/log1p.h b/libclc/opencl/include/clc/opencl/math/log1p.h
similarity index 100%
rename from libclc/generic/include/clc/math/log1p.h
rename to libclc/opencl/include/clc/opencl/math/log1p.h
diff --git a/libclc/generic/include/clc/math/log2.h b/libclc/opencl/include/clc/opencl/math/log2.h
similarity index 100%
rename from libclc/generic/include/clc/math/log2.h
rename to libclc/opencl/include/clc/opencl/math/log2.h
diff --git a/libclc/generic/include/clc/math/logb.h b/libclc/opencl/include/clc/opencl/math/logb.h
similarity index 100%
rename from libclc/generic/include/clc/math/logb.h
rename to libclc/opencl/include/clc/opencl/math/logb.h
diff --git a/libclc/generic/include/clc/math/mad.h b/libclc/opencl/include/clc/opencl/math/mad.h
similarity index 100%
rename from libclc/generic/include/clc/math/mad.h
rename to libclc/opencl/include/clc/opencl/math/mad.h
diff --git a/libclc/generic/include/clc/math/maxmag.h b/libclc/opencl/include/clc/opencl/math/maxmag.h
similarity index 100%
rename from libclc/generic/include/clc/math/maxmag.h
rename to libclc/opencl/include/clc/opencl/math/maxmag.h
diff --git a/libclc/generic/include/clc/math/minmag.h b/libclc/opencl/include/clc/opencl/math/minmag.h
similarity index 100%
rename from libclc/generic/include/clc/math/minmag.h
rename to libclc/opencl/include/clc/opencl/math/minmag.h
diff --git a/libclc/generic/include/clc/math/modf.h b/libclc/opencl/include/clc/opencl/math/modf.h
similarity index 100%
rename from libclc/generic/include/clc/math/modf.h
rename to libclc/opencl/include/clc/opencl/math/modf.h
diff --git a/libclc/generic/include/clc/math/nan.h b/libclc/opencl/include/clc/opencl/math/nan.h
similarity index 89%
rename from libclc/generic/include/clc/math/nan.h
rename to libclc/opencl/include/clc/opencl/math/nan.h
index ccd209ffe4427..c5be0af945a57 100644
--- a/libclc/generic/include/clc/math/nan.h
+++ b/libclc/opencl/include/clc/opencl/math/nan.h
@@ -6,5 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/math/nan.inc>
+#define __CLC_BODY <clc/opencl/math/nan.inc>
 #include <clc/math/gentype.inc>
diff --git a/libclc/generic/include/clc/math/nan.inc b/libclc/opencl/include/clc/opencl/math/nan.inc
similarity index 100%
rename from libclc/generic/include/clc/math/nan.inc
rename to libclc/opencl/include/clc/opencl/math/nan.inc
diff --git a/libclc/generic/include/clc/math/native_cos.h b/libclc/opencl/include/clc/opencl/math/native_cos.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_cos.h
rename to libclc/opencl/include/clc/opencl/math/native_cos.h
diff --git a/libclc/generic/include/clc/math/native_divide.h b/libclc/opencl/include/clc/opencl/math/native_divide.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_divide.h
rename to libclc/opencl/include/clc/opencl/math/native_divide.h
diff --git a/libclc/generic/include/clc/math/native_exp.h b/libclc/opencl/include/clc/opencl/math/native_exp.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_exp.h
rename to libclc/opencl/include/clc/opencl/math/native_exp.h
diff --git a/libclc/generic/include/clc/math/native_exp10.h b/libclc/opencl/include/clc/opencl/math/native_exp10.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_exp10.h
rename to libclc/opencl/include/clc/opencl/math/native_exp10.h
diff --git a/libclc/generic/include/clc/math/native_exp2.h b/libclc/opencl/include/clc/opencl/math/native_exp2.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_exp2.h
rename to libclc/opencl/include/clc/opencl/math/native_exp2.h
diff --git a/libclc/generic/include/clc/math/native_log.h b/libclc/opencl/include/clc/opencl/math/native_log.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_log.h
rename to libclc/opencl/include/clc/opencl/math/native_log.h
diff --git a/libclc/generic/include/clc/math/native_log10.h b/libclc/opencl/include/clc/opencl/math/native_log10.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_log10.h
rename to libclc/opencl/include/clc/opencl/math/native_log10.h
diff --git a/libclc/generic/include/clc/math/native_log2.h b/libclc/opencl/include/clc/opencl/math/native_log2.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_log2.h
rename to libclc/opencl/include/clc/opencl/math/native_log2.h
diff --git a/libclc/generic/include/clc/math/native_powr.h b/libclc/opencl/include/clc/opencl/math/native_powr.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_powr.h
rename to libclc/opencl/include/clc/opencl/math/native_powr.h
diff --git a/libclc/generic/include/clc/math/native_recip.h b/libclc/opencl/include/clc/opencl/math/native_recip.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_recip.h
rename to libclc/opencl/include/clc/opencl/math/native_recip.h
diff --git a/libclc/generic/include/clc/math/native_rsqrt.h b/libclc/opencl/include/clc/opencl/math/native_rsqrt.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_rsqrt.h
rename to libclc/opencl/include/clc/opencl/math/native_rsqrt.h
diff --git a/libclc/generic/include/clc/math/native_sin.h b/libclc/opencl/include/clc/opencl/math/native_sin.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_sin.h
rename to libclc/opencl/include/clc/opencl/math/native_sin.h
diff --git a/libclc/generic/include/clc/math/native_sqrt.h b/libclc/opencl/include/clc/opencl/math/native_sqrt.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_sqrt.h
rename to libclc/opencl/include/clc/opencl/math/native_sqrt.h
diff --git a/libclc/generic/include/clc/math/native_tan.h b/libclc/opencl/include/clc/opencl/math/native_tan.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_tan.h
rename to libclc/opencl/include/clc/opencl/math/native_tan.h
diff --git a/libclc/generic/include/clc/math/nextafter.h b/libclc/opencl/include/clc/opencl/math/nextafter.h
similarity index 100%
rename from libclc/generic/include/clc/math/nextafter.h
rename to libclc/opencl/include/clc/opencl/math/nextafter.h
diff --git a/libclc/generic/include/clc/math/pow.h b/libclc/opencl/include/clc/opencl/math/pow.h
similarity index 100%
rename from libclc/generic/include/clc/math/pow.h
rename to libclc/opencl/include/clc/opencl/math/pow.h
diff --git a/libclc/generic/include/clc/math/pown.h b/libclc/opencl/include/clc/opencl/math/pown.h
similarity index 100%
rename from libclc/generic/include/clc/math/pown.h
rename to libclc/opencl/include/clc/opencl/math/pown.h
diff --git a/libclc/generic/include/clc/math/powr.h b/libclc/opencl/include/clc/opencl/math/powr.h
similarity index 100%
rename from libclc/generic/include/clc/math/powr.h
rename to libclc/opencl/include/clc/opencl/math/powr.h
diff --git a/libclc/generic/include/clc/math/remainder.h b/libclc/opencl/include/clc/opencl/math/remainder.h
similarity index 100%
rename from libclc/generic/include/clc/math/remainder.h
rename to libclc/opencl/include/clc/opencl/math/remainder.h
diff --git a/libclc/generic/include/clc/math/remquo.h b/libclc/opencl/include/clc/opencl/math/remquo.h
similarity index 100%
rename from libclc/generic/include/clc/math/remquo.h
rename to libclc/opencl/include/clc/opencl/math/remquo.h
diff --git a/libclc/generic/include/clc/math/rint.h b/libclc/opencl/include/clc/opencl/math/rint.h
similarity index 100%
rename from libclc/generic/include/clc/math/rint.h
rename to libclc/opencl/include/clc/opencl/math/rint.h
diff --git a/libclc/generic/include/clc/math/rootn.h b/libclc/opencl/include/clc/opencl/math/rootn.h
similarity index 100%
rename from libclc/generic/include/clc/math/rootn.h
rename to libclc/opencl/include/clc/opencl/math/rootn.h
diff --git a/libclc/generic/include/clc/math/round.h b/libclc/opencl/include/clc/opencl/math/round.h
similarity index 100%
rename from libclc/generic/include/clc/math/round.h
rename to libclc/opencl/include/clc/opencl/math/round.h
diff --git a/libclc/generic/include/clc/math/rsqrt.h b/libclc/opencl/include/clc/opencl/math/rsqrt.h
similarity index 100%
rename from libclc/generic/include/clc/math/rsqrt.h
rename to libclc/opencl/include/clc/opencl/math/rsqrt.h
diff --git a/libclc/generic/include/clc/math/sin.h b/libclc/opencl/include/clc/opencl/math/sin.h
similarity index 100%
rename from libclc/generic/include/clc/math/sin.h
rename to libclc/opencl/include/clc/opencl/math/sin.h
diff --git a/libclc/generic/include/clc/math/sincos.h b/libclc/opencl/include/clc/opencl/math/sincos.h
similarity index 100%
rename from libclc/generic/include/clc/math/sincos.h
rename to libclc/opencl/include/clc/opencl/math/sincos.h
diff --git a/libclc/generic/include/clc/math/sinh.h b/libclc/opencl/include/clc/opencl/math/sinh.h
similarity index 100%
rename from libclc/generic/include/clc/math/sinh.h
rename to libclc/opencl/include/clc/opencl/math/sinh.h
diff --git a/libclc/generic/include/clc/math/sinpi.h b/libclc/opencl/include/clc/opencl/math/sinpi.h
similarity index 100%
rename from libclc/generic/include/clc/math/sinpi.h
rename to libclc/opencl/include/clc/opencl/math/sinpi.h
diff --git a/libclc/generic/include/clc/math/sqrt.h b/libclc/opencl/include/clc/opencl/math/sqrt.h
similarity index 100%
rename from libclc/generic/include/clc/math/sqrt.h
rename to libclc/opencl/include/clc/opencl/math/sqrt.h
diff --git a/libclc/generic/include/clc/math/tan.h b/libclc/opencl/include/clc/opencl/math/tan.h
similarity index 100%
rename from libclc/generic/include/clc/math/tan.h
rename to libclc/opencl/include/clc/opencl/math/tan.h
diff --git a/libclc/generic/include/clc/math/tanh.h b/libclc/opencl/include/clc/opencl/math/tanh.h
similarity index 100%
rename from libclc/generic/include/clc/math/tanh.h
rename to libclc/opencl/include/clc/opencl/math/tanh.h
diff --git a/libclc/generic/include/clc/math/tanpi.h b/libclc/opencl/include/clc/opencl/math/tanpi.h
similarity index 100%
rename from libclc/generic/include/clc/math/tanpi.h
rename to libclc/opencl/include/clc/opencl/math/tanpi.h
diff --git a/libclc/generic/include/clc/math/tgamma.h b/libclc/opencl/include/clc/opencl/math/tgamma.h
similarity index 100%
rename from libclc/generic/include/clc/math/tgamma.h
rename to libclc/opencl/include/clc/opencl/math/tgamma.h
diff --git a/libclc/generic/include/clc/math/trunc.h b/libclc/opencl/include/clc/opencl/math/trunc.h
similarity index 100%
rename from libclc/generic/include/clc/math/trunc.h
rename to libclc/opencl/include/clc/opencl/math/trunc.h
diff --git a/libclc/generic/include/clc/misc/shuffle.h b/libclc/opencl/include/clc/opencl/misc/shuffle.h
similarity index 100%
rename from libclc/generic/include/clc/misc/shuffle.h
rename to libclc/opencl/include/clc/opencl/misc/shuffle.h
diff --git a/libclc/generic/include/clc/misc/shuffle2.h b/libclc/opencl/include/clc/opencl/misc/shuffle2.h
similarity index 100%
rename from libclc/generic/include/clc/misc/shuffle2.h
rename to libclc/opencl/include/clc/opencl/misc/shuffle2.h
diff --git a/libclc/generic/include/clc/relational/all.h b/libclc/opencl/include/clc/opencl/relational/all.h
similarity index 100%
rename from libclc/generic/include/clc/relational/all.h
rename to libclc/opencl/include/clc/opencl/relational/all.h
diff --git a/libclc/generic/include/clc/relational/any.h b/libclc/opencl/include/clc/opencl/relational/any.h
similarity index 100%
rename from libclc/generic/include/clc/relational/any.h
rename to libclc/opencl/include/clc/opencl/relational/any.h
diff --git a/libclc/generic/include/clc/relational/bitselect.h b/libclc/opencl/include/clc/opencl/relational/bitselect.h
similarity index 79%
rename from libclc/generic/include/clc/relational/bitselect.h
rename to libclc/opencl/include/clc/opencl/relational/bitselect.h
index 25cb0c2fd9241..7a39d5468e5ff 100644
--- a/libclc/generic/include/clc/relational/bitselect.h
+++ b/libclc/opencl/include/clc/opencl/relational/bitselect.h
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/relational/bitselect.inc>
+#define __CLC_BODY <clc/opencl/relational/bitselect.inc>
 #include <clc/math/gentype.inc>
-#define __CLC_BODY <clc/relational/bitselect.inc>
+#define __CLC_BODY <clc/opencl/relational/bitselect.inc>
 #include <clc/integer/gentype.inc>
diff --git a/libclc/generic/include/clc/relational/bitselect.inc b/libclc/opencl/include/clc/opencl/relational/bitselect.inc
similarity index 100%
rename from libclc/generic/include/clc/relational/bitselect.inc
rename to libclc/opencl/include/clc/opencl/relational/bitselect.inc
diff --git a/libclc/generic/include/clc/relational/isequal.h b/libclc/opencl/include/clc/opencl/relational/isequal.h
similarity index 100%
rename from libclc/generic/include/clc/relational/isequal.h
rename to libclc/opencl/include/clc/opencl/relational/isequal.h
diff --git a/libclc/generic/include/clc/relational/isfinite.h b/libclc/opencl/include/clc/opencl/relational/isfinite.h
similarity index 100%
rename from libclc/generic/include/clc/relational/isfinite.h
rename to libclc/opencl/include/clc/opencl/relational/isfinite.h
diff --git a/libclc/generic/include/clc/relational/isgreater.h b/libclc/opencl/include/clc/opencl/relational/isgreater.h
similarity index 100%
rename from libclc/generic/include/clc/relational/isgreater.h
rename to libclc/opencl/include/clc/opencl/relational/isgreater.h
diff --git a/libclc/generic/include/clc/relational/isgreaterequal.h b/libclc/opencl/include/clc/opencl/relational/isgreaterequal.h
similarity index 100%
rename from libclc/generic/include/clc/relational/isgreaterequal.h
rename to libclc/opencl/include/clc/opencl/relational/isgreaterequal.h
diff --git a/libclc/generic/include/clc/relational/isinf.h b/libclc/opencl/include/clc/opencl/relational/isinf.h
similarity index 100%
rename from libclc/generic/include/clc/relational/isinf.h
rename to libclc/opencl/include/clc/opencl/relational/isinf.h
diff --git a/libclc/generic/include/clc/relational/isless.h b/libclc/opencl/include/clc/opencl/relational/isless.h
similarity index 100%
rename from libclc/generic/include/clc/relational/isless.h
rename to libclc/opencl/include/clc/opencl/relational/isless.h
diff --git a/libclc/generic/include/clc/relational/islessequal.h b/libclc/opencl/include/clc/opencl/relational/islessequal.h
similarity index 100%
rename from libclc/generic/include/clc/relational/islessequal.h
rename to libclc/opencl/include/clc/opencl/relational/islessequal.h
diff --git a/libclc/generic/include/clc/relational/islessgreater.h b/libclc/opencl/include/clc/opencl/relational/islessgreater.h
similarity index 100%
rename from libclc/generic/include/clc/relational/islessgreater.h
rename to libclc/opencl/include/clc/opencl/relational/islessgreater.h
diff --git a/libclc/generic/include/clc/relational/isnan.h b/libclc/opencl/include/clc/opencl/relational/isnan.h
similarity index 100%
rename from libclc/generic/include/clc/relational/isnan.h
rename to libclc/opencl/include/clc/opencl/relational/isnan.h
diff --git a/libclc/generic/include/clc/relational/isnormal.h b/libclc/opencl/include/clc/opencl/relational/isnormal.h
similarity index 100%
rename from libclc/generic/include/clc/relational/isnormal.h
rename to libclc/opencl/include/clc/opencl/relational/isnormal.h
diff --git a/libclc/generic/include/clc/relational/isnotequal.h b/libclc/opencl/include/clc/opencl/relational/isnotequal.h
similarity index 100%
rename from libclc/generic/include/clc/relational/isnotequal.h
rename to libclc/opencl/include/clc/opencl/relational/isnotequal.h
diff --git a/libclc/generic/include/clc/relational/isordered.h b/libclc/opencl/include/clc/opencl/relational/isordered.h
similarity index 100%
rename from libclc/generic/include/clc/relational/isordered.h
rename to libclc/opencl/include/clc/opencl/relational/isordered.h
diff --git a/libclc/generic/include/clc/relational/isunordered.h b/libclc/opencl/include/clc/opencl/relational/isunordered.h
similarity index 100%
rename from libclc/generic/include/clc/relational/isunordered.h
rename to libclc/opencl/include/clc/opencl/relational/isunordered.h
diff --git a/libclc/generic/include/clc/relational/select.h b/libclc/opencl/include/clc/opencl/relational/select.h
similarity index 100%
rename from libclc/generic/include/clc/relational/select.h
rename to libclc/opencl/include/clc/opencl/relational/select.h
diff --git a/libclc/generic/include/clc/relational/signbit.h b/libclc/opencl/include/clc/opencl/relational/signbit.h
similarity index 100%
rename from libclc/generic/include/clc/relational/signbit.h
rename to libclc/opencl/include/clc/opencl/relational/signbit.h
diff --git a/libclc/generic/include/clc/shared/clamp.h b/libclc/opencl/include/clc/opencl/shared/clamp.h
similarity index 81%
rename from libclc/generic/include/clc/shared/clamp.h
rename to libclc/opencl/include/clc/opencl/shared/clamp.h
index 06d2282cebc66..4fe7897f56016 100644
--- a/libclc/generic/include/clc/shared/clamp.h
+++ b/libclc/opencl/include/clc/opencl/shared/clamp.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/shared/clamp.inc>
+#define __CLC_BODY <clc/opencl/shared/clamp.inc>
 #include <clc/integer/gentype.inc>
 
-#define __CLC_BODY <clc/shared/clamp.inc>
+#define __CLC_BODY <clc/opencl/shared/clamp.inc>
 #include <clc/math/gentype.inc>
diff --git a/libclc/generic/include/clc/shared/clamp.inc b/libclc/opencl/include/clc/opencl/shared/clamp.inc
similarity index 100%
rename from libclc/generic/include/clc/shared/clamp.inc
rename to libclc/opencl/include/clc/opencl/shared/clamp.inc
diff --git a/libclc/generic/include/clc/shared/max.h b/libclc/opencl/include/clc/opencl/shared/max.h
similarity index 82%
rename from libclc/generic/include/clc/shared/max.h
rename to libclc/opencl/include/clc/opencl/shared/max.h
index 0b56e56f4aee1..5ff01ba8082a2 100644
--- a/libclc/generic/include/clc/shared/max.h
+++ b/libclc/opencl/include/clc/opencl/shared/max.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/shared/max.inc>
+#define __CLC_BODY <clc/opencl/shared/max.inc>
 #include <clc/integer/gentype.inc>
 
-#define __CLC_BODY <clc/shared/max.inc>
+#define __CLC_BODY <clc/opencl/shared/max.inc>
 #include <clc/math/gentype.inc>
diff --git a/libclc/generic/include/clc/shared/max.inc b/libclc/opencl/include/clc/opencl/shared/max.inc
similarity index 100%
rename from libclc/generic/include/clc/shared/max.inc
rename to libclc/opencl/include/clc/opencl/shared/max.inc
diff --git a/libclc/generic/include/clc/shared/min.h b/libclc/opencl/include/clc/opencl/shared/min.h
similarity index 82%
rename from libclc/generic/include/clc/shared/min.h
rename to libclc/opencl/include/clc/opencl/shared/min.h
index 090fae2651883..573f837685be1 100644
--- a/libclc/generic/include/clc/shared/min.h
+++ b/libclc/opencl/include/clc/opencl/shared/min.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/shared/min.inc>
+#define __CLC_BODY <clc/opencl/shared/min.inc>
 #include <clc/integer/gentype.inc>
 
-#define __CLC_BODY <clc/shared/min.inc>
+#define __CLC_BODY <clc/opencl/shared/min.inc>
 #include <clc/math/gentype.inc>
diff --git a/libclc/generic/include/clc/shared/min.inc b/libclc/opencl/include/clc/opencl/shared/min.inc
similarity index 100%
rename from libclc/generic/include/clc/shared/min.inc
rename to libclc/opencl/include/clc/opencl/shared/min.inc
diff --git a/libclc/generic/include/clc/shared/vload.h b/libclc/opencl/include/clc/opencl/shared/vload.h
similarity index 100%
rename from libclc/generic/include/clc/shared/vload.h
rename to libclc/opencl/include/clc/opencl/shared/vload.h
diff --git a/libclc/generic/include/clc/shared/vstore.h b/libclc/opencl/include/clc/opencl/shared/vstore.h
similarity index 100%
rename from libclc/generic/include/clc/shared/vstore.h
rename to libclc/opencl/include/clc/opencl/shared/vstore.h
diff --git a/libclc/generic/include/clc/synchronization/barrier.h b/libclc/opencl/include/clc/opencl/synchronization/barrier.h
similarity index 100%
rename from libclc/generic/include/clc/synchronization/barrier.h
rename to libclc/opencl/include/clc/opencl/synchronization/barrier.h
diff --git a/libclc/generic/include/clc/synchronization/cl_mem_fence_flags.h b/libclc/opencl/include/clc/opencl/synchronization/cl_mem_fence_flags.h
similarity index 100%
rename from libclc/generic/include/clc/synchronization/cl_mem_fence_flags.h
rename to libclc/opencl/include/clc/opencl/synchronization/cl_mem_fence_flags.h
diff --git a/libclc/generic/include/clc/workitem/get_global_id.h b/libclc/opencl/include/clc/opencl/workitem/get_global_id.h
similarity index 100%
rename from libclc/generic/include/clc/workitem/get_global_id.h
rename to libclc/opencl/include/clc/opencl/workitem/get_global_id.h
diff --git a/libclc/generic/include/clc/workitem/get_global_offset.h b/libclc/opencl/include/clc/opencl/workitem/get_global_offset.h
similarity index 100%
rename from libclc/generic/include/clc/workitem/get_global_offset.h
rename to libclc/opencl/include/clc/opencl/workitem/get_global_offset.h
diff --git a/libclc/generic/include/clc/workitem/get_global_size.h b/libclc/opencl/include/clc/opencl/workitem/get_global_size.h
similarity index 100%
rename from libclc/generic/include/clc/workitem/get_global_size.h
rename to libclc/opencl/include/clc/opencl/workitem/get_global_size.h
diff --git a/libclc/generic/include/clc/workitem/get_group_id.h b/libclc/opencl/include/clc/opencl/workitem/get_group_id.h
similarity index 100%
rename from libclc/generic/include/clc/workitem/get_group_id.h
rename to libclc/opencl/include/clc/opencl/workitem/get_group_id.h
diff --git a/libclc/generic/include/clc/workitem/get_local_id.h b/libclc/opencl/include/clc/opencl/workitem/get_local_id.h
similarity index 100%
rename from libclc/generic/include/clc/workitem/get_local_id.h
rename to libclc/opencl/include/clc/opencl/workitem/get_local_id.h
diff --git a/libclc/generic/include/clc/workitem/get_local_size.h b/libclc/opencl/include/clc/opencl/workitem/get_local_size.h
similarity index 100%
rename from libclc/generic/include/clc/workitem/get_local_size.h
rename to libclc/opencl/include/clc/opencl/workitem/get_local_size.h
diff --git a/libclc/generic/include/clc/workitem/get_num_groups.h b/libclc/opencl/include/clc/opencl/workitem/get_num_groups.h
similarity index 100%
rename from libclc/generic/include/clc/workitem/get_num_groups.h
rename to libclc/opencl/include/clc/opencl/workitem/get_num_groups.h
diff --git a/libclc/generic/include/clc/workitem/get_work_dim.h b/libclc/opencl/include/clc/opencl/workitem/get_work_dim.h
similarity index 100%
rename from libclc/generic/include/clc/workitem/get_work_dim.h
rename to libclc/opencl/include/clc/opencl/workitem/get_work_dim.h
diff --git a/libclc/amdgcn-amdhsa/lib/SOURCES b/libclc/opencl/lib/amdgcn-amdhsa/SOURCES
similarity index 100%
rename from libclc/amdgcn-amdhsa/lib/SOURCES
rename to libclc/opencl/lib/amdgcn-amdhsa/SOURCES
diff --git a/libclc/amdgcn-amdhsa/lib/workitem/get_global_size.cl b/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_global_size.cl
similarity index 97%
rename from libclc/amdgcn-amdhsa/lib/workitem/get_global_size.cl
rename to libclc/opencl/lib/amdgcn-amdhsa/workitem/get_global_size.cl
index 6d48a40117115..eeac17a426558 100644
--- a/libclc/amdgcn-amdhsa/lib/workitem/get_global_size.cl
+++ b/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_global_size.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #if __clang_major__ >= 8
 #define CONST_AS __constant
diff --git a/libclc/amdgcn-amdhsa/lib/workitem/get_local_size.cl b/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_local_size.cl
similarity index 97%
rename from libclc/amdgcn-amdhsa/lib/workitem/get_local_size.cl
rename to libclc/opencl/lib/amdgcn-amdhsa/workitem/get_local_size.cl
index 5ef8e1fd4435c..4781c400be30c 100644
--- a/libclc/amdgcn-amdhsa/lib/workitem/get_local_size.cl
+++ b/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_local_size.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #if __clang_major__ >= 8
 #define CONST_AS __constant
diff --git a/libclc/amdgcn-amdhsa/lib/workitem/get_num_groups.cl b/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_num_groups.cl
similarity index 95%
rename from libclc/amdgcn-amdhsa/lib/workitem/get_num_groups.cl
rename to libclc/opencl/lib/amdgcn-amdhsa/workitem/get_num_groups.cl
index 2ef5197cd1fd3..4fb088fb0127a 100644
--- a/libclc/amdgcn-amdhsa/lib/workitem/get_num_groups.cl
+++ b/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_num_groups.cl
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_num_groups(uint dim) {
   size_t global_size = get_global_size(dim);
diff --git a/libclc/amdgcn/lib/SOURCES b/libclc/opencl/lib/amdgcn/SOURCES
similarity index 100%
rename from libclc/amdgcn/lib/SOURCES
rename to libclc/opencl/lib/amdgcn/SOURCES
diff --git a/libclc/amdgcn/lib/cl_khr_int64_extended_atomics/minmax_helpers.ll b/libclc/opencl/lib/amdgcn/cl_khr_int64_extended_atomics/minmax_helpers.ll
similarity index 100%
rename from libclc/amdgcn/lib/cl_khr_int64_extended_atomics/minmax_helpers.ll
rename to libclc/opencl/lib/amdgcn/cl_khr_int64_extended_atomics/minmax_helpers.ll
diff --git a/libclc/amdgcn/lib/mem_fence/fence.cl b/libclc/opencl/lib/amdgcn/mem_fence/fence.cl
similarity index 98%
rename from libclc/amdgcn/lib/mem_fence/fence.cl
rename to libclc/opencl/lib/amdgcn/mem_fence/fence.cl
index 8d3492ed9122f..5e0180dc166b3 100644
--- a/libclc/amdgcn/lib/mem_fence/fence.cl
+++ b/libclc/opencl/lib/amdgcn/mem_fence/fence.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 void __clc_amdgcn_s_waitcnt(unsigned flags);
 
diff --git a/libclc/amdgcn/lib/synchronization/barrier.cl b/libclc/opencl/lib/amdgcn/synchronization/barrier.cl
similarity index 94%
rename from libclc/amdgcn/lib/synchronization/barrier.cl
rename to libclc/opencl/lib/amdgcn/synchronization/barrier.cl
index 248b9c1462b0c..f7c41aafa83c9 100644
--- a/libclc/amdgcn/lib/synchronization/barrier.cl
+++ b/libclc/opencl/lib/amdgcn/synchronization/barrier.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD void barrier(cl_mem_fence_flags flags) {
   mem_fence(flags);
diff --git a/libclc/amdgcn/lib/workitem/get_global_offset.cl b/libclc/opencl/lib/amdgcn/workitem/get_global_offset.cl
similarity index 96%
rename from libclc/amdgcn/lib/workitem/get_global_offset.cl
rename to libclc/opencl/lib/amdgcn/workitem/get_global_offset.cl
index 240dd806734df..a1b3ce4192793 100644
--- a/libclc/amdgcn/lib/workitem/get_global_offset.cl
+++ b/libclc/opencl/lib/amdgcn/workitem/get_global_offset.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #if __clang_major__ >= 8
 #define CONST_AS __constant
diff --git a/libclc/amdgcn/lib/workitem/get_global_size.cl b/libclc/opencl/lib/amdgcn/workitem/get_global_size.cl
similarity index 95%
rename from libclc/amdgcn/lib/workitem/get_global_size.cl
rename to libclc/opencl/lib/amdgcn/workitem/get_global_size.cl
index 9626d5f3e80e3..8f1507765f934 100644
--- a/libclc/amdgcn/lib/workitem/get_global_size.cl
+++ b/libclc/opencl/lib/amdgcn/workitem/get_global_size.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_global_size(uint dim) {
   switch (dim) {
diff --git a/libclc/amdgcn/lib/workitem/get_group_id.cl b/libclc/opencl/lib/amdgcn/workitem/get_group_id.cl
similarity index 95%
rename from libclc/amdgcn/lib/workitem/get_group_id.cl
rename to libclc/opencl/lib/amdgcn/workitem/get_group_id.cl
index d4ad33df95194..446cc63ab759d 100644
--- a/libclc/amdgcn/lib/workitem/get_group_id.cl
+++ b/libclc/opencl/lib/amdgcn/workitem/get_group_id.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_group_id(uint dim) {
   switch (dim) {
diff --git a/libclc/amdgcn/lib/workitem/get_local_id.cl b/libclc/opencl/lib/amdgcn/workitem/get_local_id.cl
similarity index 95%
rename from libclc/amdgcn/lib/workitem/get_local_id.cl
rename to libclc/opencl/lib/amdgcn/workitem/get_local_id.cl
index 01709e0cf84ce..cd07d8645cd53 100644
--- a/libclc/amdgcn/lib/workitem/get_local_id.cl
+++ b/libclc/opencl/lib/amdgcn/workitem/get_local_id.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_local_id(uint dim) {
   switch (dim) {
diff --git a/libclc/amdgcn/lib/workitem/get_local_size.cl b/libclc/opencl/lib/amdgcn/workitem/get_local_size.cl
similarity index 96%
rename from libclc/amdgcn/lib/workitem/get_local_size.cl
rename to libclc/opencl/lib/amdgcn/workitem/get_local_size.cl
index 9cb0dc7316a2c..cec2d358df8ac 100644
--- a/libclc/amdgcn/lib/workitem/get_local_size.cl
+++ b/libclc/opencl/lib/amdgcn/workitem/get_local_size.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 uint __clc_amdgcn_get_local_size_x(void) __asm("llvm.r600.read.local.size.x");
 uint __clc_amdgcn_get_local_size_y(void) __asm("llvm.r600.read.local.size.y");
diff --git a/libclc/amdgcn/lib/workitem/get_num_groups.cl b/libclc/opencl/lib/amdgcn/workitem/get_num_groups.cl
similarity index 96%
rename from libclc/amdgcn/lib/workitem/get_num_groups.cl
rename to libclc/opencl/lib/amdgcn/workitem/get_num_groups.cl
index 90bcc328aa000..0d8f0b8736585 100644
--- a/libclc/amdgcn/lib/workitem/get_num_groups.cl
+++ b/libclc/opencl/lib/amdgcn/workitem/get_num_groups.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 uint __clc_amdgcn_get_num_groups_x(void) __asm("llvm.r600.read.ngroups.x");
 uint __clc_amdgcn_get_num_groups_y(void) __asm("llvm.r600.read.ngroups.y");
diff --git a/libclc/amdgcn/lib/workitem/get_work_dim.cl b/libclc/opencl/lib/amdgcn/workitem/get_work_dim.cl
similarity index 96%
rename from libclc/amdgcn/lib/workitem/get_work_dim.cl
rename to libclc/opencl/lib/amdgcn/workitem/get_work_dim.cl
index 2f6e3d3209508..8ca8b0b61ce54 100644
--- a/libclc/amdgcn/lib/workitem/get_work_dim.cl
+++ b/libclc/opencl/lib/amdgcn/workitem/get_work_dim.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #if __clang_major__ >= 8
 #define CONST_AS __constant
diff --git a/libclc/opencl/lib/clspv/SOURCES b/libclc/opencl/lib/clspv/SOURCES
new file mode 100644
index 0000000000000..0a142ed3e6043
--- /dev/null
+++ b/libclc/opencl/lib/clspv/SOURCES
@@ -0,0 +1,73 @@
+math/fma.cl
+shared/vstore_half.cl
+subnormal_config.cl
+../generic/geometric/distance.cl
+../generic/geometric/length.cl
+../generic/math/acos.cl
+../generic/math/acosh.cl
+../generic/math/asinh.cl
+../generic/math/acospi.cl
+../generic/math/asin.cl
+../generic/math/atan.cl
+../generic/math/asinh.cl
+../generic/math/asinpi.cl
+../generic/math/atan2.cl
+../generic/math/atan2pi.cl
+../generic/math/atanh.cl
+../generic/math/atanpi.cl
+../generic/math/cbrt.cl
+../generic/math/cos.cl
+../generic/math/cosh.cl
+../generic/math/cospi.cl
+../generic/math/erf.cl
+../generic/math/erfc.cl
+../generic/math/exp.cl
+../generic/math/exp10.cl
+../generic/math/exp2.cl
+../generic/math/expm1.cl
+../generic/math/fdim.cl
+../generic/math/fmod.cl
+../generic/math/fract.cl
+../generic/math/frexp.cl
+../generic/math/half_cos.cl
+../generic/math/half_divide.cl
+../generic/math/half_exp.cl
+../generic/math/half_exp10.cl
+../generic/math/half_exp2.cl
+../generic/math/half_log.cl
+../generic/math/half_log10.cl
+../generic/math/half_log2.cl
+../generic/math/half_powr.cl
+../generic/math/half_recip.cl
+../generic/math/half_sin.cl
+../generic/math/half_sqrt.cl
+../generic/math/half_tan.cl
+../generic/math/hypot.cl
+../generic/math/ilogb.cl
+../generic/math/ldexp.cl
+../generic/math/lgamma.cl
+../generic/math/lgamma_r.cl
+../generic/math/log.cl
+../generic/math/log10.cl
+../generic/math/log1p.cl
+../generic/math/log2.cl
+../generic/math/logb.cl
+../generic/math/maxmag.cl
+../generic/math/minmag.cl
+../generic/math/modf.cl
+../generic/math/nan.cl
+../generic/math/nextafter.cl
+../generic/math/pow.cl
+../generic/math/pown.cl
+../generic/math/powr.cl
+../generic/math/remainder.cl
+../generic/math/remquo.cl
+../generic/math/rootn.cl
+../generic/math/sin.cl
+../generic/math/sincos.cl
+../generic/math/sinh.cl
+../generic/math/sinpi.cl
+../generic/math/tan.cl
+../generic/math/tanh.cl
+../generic/math/tanpi.cl
+../generic/math/tgamma.cl
diff --git a/libclc/spirv/lib/math/fma.cl b/libclc/opencl/lib/clspv/math/fma.cl
similarity index 94%
rename from libclc/spirv/lib/math/fma.cl
rename to libclc/opencl/lib/clspv/math/fma.cl
index 0f3e4222dc557..014e311ff91a4 100644
--- a/libclc/spirv/lib/math/fma.cl
+++ b/libclc/opencl/lib/clspv/math/fma.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/internal/math/clc_sw_fma.h>
 
diff --git a/libclc/clspv/lib/shared/vstore_half.cl b/libclc/opencl/lib/clspv/shared/vstore_half.cl
similarity index 99%
rename from libclc/clspv/lib/shared/vstore_half.cl
rename to libclc/opencl/lib/clspv/shared/vstore_half.cl
index ee74e5d028fa1..1694ebeebe689 100644
--- a/libclc/clspv/lib/shared/vstore_half.cl
+++ b/libclc/opencl/lib/clspv/shared/vstore_half.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #pragma OPENCL EXTENSION cl_khr_byte_addressable_store : enable
 
diff --git a/libclc/clspv/lib/shared/vstore_half.inc b/libclc/opencl/lib/clspv/shared/vstore_half.inc
similarity index 100%
rename from libclc/clspv/lib/shared/vstore_half.inc
rename to libclc/opencl/lib/clspv/shared/vstore_half.inc
diff --git a/libclc/clspv/lib/subnormal_config.cl b/libclc/opencl/lib/clspv/subnormal_config.cl
similarity index 95%
rename from libclc/clspv/lib/subnormal_config.cl
rename to libclc/opencl/lib/clspv/subnormal_config.cl
index ef0e1d7742447..50997134bcd99 100644
--- a/libclc/clspv/lib/subnormal_config.cl
+++ b/libclc/opencl/lib/clspv/subnormal_config.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_subnormal_config.h>
 
 _CLC_DEF bool __clc_fp16_subnormals_supported() { return false; }
diff --git a/libclc/generic/lib/SOURCES b/libclc/opencl/lib/generic/SOURCES
similarity index 100%
rename from libclc/generic/lib/SOURCES
rename to libclc/opencl/lib/generic/SOURCES
diff --git a/libclc/generic/lib/async/async_work_group_copy.cl b/libclc/opencl/lib/generic/async/async_work_group_copy.cl
similarity index 95%
rename from libclc/generic/lib/async/async_work_group_copy.cl
rename to libclc/opencl/lib/generic/async/async_work_group_copy.cl
index 3ade4e9db9585..a0b9d7d1f52ec 100644
--- a/libclc/generic/lib/async/async_work_group_copy.cl
+++ b/libclc/opencl/lib/generic/async/async_work_group_copy.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #define __CLC_BODY <async_work_group_copy.inc>
 #include <clc/integer/gentype.inc>
diff --git a/libclc/generic/lib/async/async_work_group_copy.inc b/libclc/opencl/lib/generic/async/async_work_group_copy.inc
similarity index 100%
rename from libclc/generic/lib/async/async_work_group_copy.inc
rename to libclc/opencl/lib/generic/async/async_work_group_copy.inc
diff --git a/libclc/generic/lib/async/async_work_group_strided_copy.cl b/libclc/opencl/lib/generic/async/async_work_group_strided_copy.cl
similarity index 95%
rename from libclc/generic/lib/async/async_work_group_strided_copy.cl
rename to libclc/opencl/lib/generic/async/async_work_group_strided_copy.cl
index 899ed0a4e3aa1..ac4d1da3bc215 100644
--- a/libclc/generic/lib/async/async_work_group_strided_copy.cl
+++ b/libclc/opencl/lib/generic/async/async_work_group_strided_copy.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #define __CLC_BODY <async_work_group_strided_copy.inc>
 #include <clc/integer/gentype.inc>
diff --git a/libclc/generic/lib/async/async_work_group_strided_copy.inc b/libclc/opencl/lib/generic/async/async_work_group_strided_copy.inc
similarity index 100%
rename from libclc/generic/lib/async/async_work_group_strided_copy.inc
rename to libclc/opencl/lib/generic/async/async_work_group_strided_copy.inc
diff --git a/libclc/generic/lib/async/prefetch.cl b/libclc/opencl/lib/generic/async/prefetch.cl
similarity index 94%
rename from libclc/generic/lib/async/prefetch.cl
rename to libclc/opencl/lib/generic/async/prefetch.cl
index 8c819d8210d9a..7903550e89e41 100644
--- a/libclc/generic/lib/async/prefetch.cl
+++ b/libclc/opencl/lib/generic/async/prefetch.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #define __CLC_BODY <prefetch.inc>
 #include <clc/integer/gentype.inc>
diff --git a/libclc/generic/lib/async/prefetch.inc b/libclc/opencl/lib/generic/async/prefetch.inc
similarity index 100%
rename from libclc/generic/lib/async/prefetch.inc
rename to libclc/opencl/lib/generic/async/prefetch.inc
diff --git a/libclc/generic/lib/async/wait_group_events.cl b/libclc/opencl/lib/generic/async/wait_group_events.cl
similarity index 95%
rename from libclc/generic/lib/async/wait_group_events.cl
rename to libclc/opencl/lib/generic/async/wait_group_events.cl
index 09c989cdb5ee4..e353e48cfe09f 100644
--- a/libclc/generic/lib/async/wait_group_events.cl
+++ b/libclc/opencl/lib/generic/async/wait_group_events.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD void wait_group_events(int num_events,
                                               event_t *event_list) {
diff --git a/libclc/generic/lib/atomic/atom_add.cl b/libclc/opencl/lib/generic/atomic/atom_add.cl
similarity index 96%
rename from libclc/generic/lib/atomic/atom_add.cl
rename to libclc/opencl/lib/generic/atomic/atom_add.cl
index 282b24dcbd1c9..9f60881c2717d 100644
--- a/libclc/generic/lib/atomic/atom_add.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_add.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_add.h>
+#include <clc/opencl/atomic/atom_add.h>
 
 #ifdef cl_khr_global_int32_base_atomics
 #define __CLC_ATOMIC_OP add
diff --git a/libclc/generic/lib/atomic/atom_and.cl b/libclc/opencl/lib/generic/atomic/atom_and.cl
similarity index 96%
rename from libclc/generic/lib/atomic/atom_and.cl
rename to libclc/opencl/lib/generic/atomic/atom_and.cl
index 2c95d2a7780c3..2653296d29e4f 100644
--- a/libclc/generic/lib/atomic/atom_and.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_and.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_and.h>
+#include <clc/opencl/atomic/atom_and.h>
 
 #ifdef cl_khr_global_int32_extended_atomics
 #define __CLC_ATOMIC_OP and
diff --git a/libclc/generic/lib/atomic/atom_cmpxchg.cl b/libclc/opencl/lib/generic/atomic/atom_cmpxchg.cl
similarity index 94%
rename from libclc/generic/lib/atomic/atom_cmpxchg.cl
rename to libclc/opencl/lib/generic/atomic/atom_cmpxchg.cl
index e29707af84cb3..f129be9809e51 100644
--- a/libclc/generic/lib/atomic/atom_cmpxchg.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_cmpxchg.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_cmpxchg.h>
-#include <clc/atomic/atomic_cmpxchg.h>
+#include <clc/opencl/atomic/atom_cmpxchg.h>
+#include <clc/opencl/atomic/atomic_cmpxchg.h>
 
 #define IMPL(AS, TYPE)                                                         \
   _CLC_OVERLOAD _CLC_DEF TYPE atom_cmpxchg(volatile AS TYPE *p, TYPE cmp,      \
diff --git a/libclc/generic/lib/atomic/atom_dec.cl b/libclc/opencl/lib/generic/atomic/atom_dec.cl
similarity index 91%
rename from libclc/generic/lib/atomic/atom_dec.cl
rename to libclc/opencl/lib/generic/atomic/atom_dec.cl
index 8fb5495397d69..2df721cae365a 100644
--- a/libclc/generic/lib/atomic/atom_dec.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_dec.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_dec.h>
-#include <clc/atomic/atom_sub.h>
-#include <clc/atomic/atomic_dec.h>
+#include <clc/opencl/atomic/atom_dec.h>
+#include <clc/opencl/atomic/atom_sub.h>
+#include <clc/opencl/atomic/atomic_dec.h>
 
 #define IMPL(AS, TYPE)                                                         \
   _CLC_OVERLOAD _CLC_DEF TYPE atom_dec(volatile AS TYPE *p) {                  \
diff --git a/libclc/generic/lib/atomic/atom_inc.cl b/libclc/opencl/lib/generic/atomic/atom_inc.cl
similarity index 91%
rename from libclc/generic/lib/atomic/atom_inc.cl
rename to libclc/opencl/lib/generic/atomic/atom_inc.cl
index c74df54eb4893..dc7699a478020 100644
--- a/libclc/generic/lib/atomic/atom_inc.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_inc.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_add.h>
-#include <clc/atomic/atom_inc.h>
-#include <clc/atomic/atomic_inc.h>
+#include <clc/opencl/atomic/atom_add.h>
+#include <clc/opencl/atomic/atom_inc.h>
+#include <clc/opencl/atomic/atomic_inc.h>
 
 #define IMPL(AS, TYPE)                                                         \
   _CLC_OVERLOAD _CLC_DEF TYPE atom_inc(volatile AS TYPE *p) {                  \
diff --git a/libclc/generic/lib/atomic/atom_int32_binary.inc b/libclc/opencl/lib/generic/atomic/atom_int32_binary.inc
similarity index 96%
rename from libclc/generic/lib/atomic/atom_int32_binary.inc
rename to libclc/opencl/lib/generic/atomic/atom_int32_binary.inc
index 81e6a8ebc7c8a..bee20d9146420 100644
--- a/libclc/generic/lib/atomic/atom_int32_binary.inc
+++ b/libclc/opencl/lib/generic/atomic/atom_int32_binary.inc
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/utils.h>
 
 #define __CLC_ATOM_IMPL(AS, TYPE)                                              \
diff --git a/libclc/generic/lib/atomic/atom_max.cl b/libclc/opencl/lib/generic/atomic/atom_max.cl
similarity index 97%
rename from libclc/generic/lib/atomic/atom_max.cl
rename to libclc/opencl/lib/generic/atomic/atom_max.cl
index 9427732fe7a4d..744f39f6cb494 100644
--- a/libclc/generic/lib/atomic/atom_max.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_max.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_max.h>
+#include <clc/opencl/atomic/atom_max.h>
 
 #ifdef cl_khr_global_int32_extended_atomics
 #define __CLC_ATOMIC_OP max
diff --git a/libclc/generic/lib/atomic/atom_min.cl b/libclc/opencl/lib/generic/atomic/atom_min.cl
similarity index 97%
rename from libclc/generic/lib/atomic/atom_min.cl
rename to libclc/opencl/lib/generic/atomic/atom_min.cl
index 881e832932910..75e5fb02e1289 100644
--- a/libclc/generic/lib/atomic/atom_min.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_min.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_min.h>
+#include <clc/opencl/atomic/atom_min.h>
 
 #ifdef cl_khr_global_int32_extended_atomics
 #define __CLC_ATOMIC_OP min
diff --git a/libclc/generic/lib/atomic/atom_or.cl b/libclc/opencl/lib/generic/atomic/atom_or.cl
similarity index 96%
rename from libclc/generic/lib/atomic/atom_or.cl
rename to libclc/opencl/lib/generic/atomic/atom_or.cl
index a9f9bb782fb2f..4b1ecac95d878 100644
--- a/libclc/generic/lib/atomic/atom_or.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_or.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_or.h>
+#include <clc/opencl/atomic/atom_or.h>
 
 #ifdef cl_khr_global_int32_extended_atomics
 #define __CLC_ATOMIC_OP or
diff --git a/libclc/generic/lib/atomic/atom_sub.cl b/libclc/opencl/lib/generic/atomic/atom_sub.cl
similarity index 96%
rename from libclc/generic/lib/atomic/atom_sub.cl
rename to libclc/opencl/lib/generic/atomic/atom_sub.cl
index 1951f985688b2..24c7e85ca73a2 100644
--- a/libclc/generic/lib/atomic/atom_sub.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_sub.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_sub.h>
+#include <clc/opencl/atomic/atom_sub.h>
 
 #ifdef cl_khr_global_int32_base_atomics
 #define __CLC_ATOMIC_OP sub
diff --git a/libclc/generic/lib/atomic/atom_xchg.cl b/libclc/opencl/lib/generic/atomic/atom_xchg.cl
similarity index 96%
rename from libclc/generic/lib/atomic/atom_xchg.cl
rename to libclc/opencl/lib/generic/atomic/atom_xchg.cl
index 6e9ef796d9c0d..f14b18070deb0 100644
--- a/libclc/generic/lib/atomic/atom_xchg.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_xchg.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_xchg.h>
+#include <clc/opencl/atomic/atom_xchg.h>
 
 #ifdef cl_khr_global_int32_base_atomics
 #define __CLC_ATOMIC_OP xchg
diff --git a/libclc/generic/lib/atomic/atom_xor.cl b/libclc/opencl/lib/generic/atomic/atom_xor.cl
similarity index 96%
rename from libclc/generic/lib/atomic/atom_xor.cl
rename to libclc/opencl/lib/generic/atomic/atom_xor.cl
index bfa978d4b9a12..9373fae2487de 100644
--- a/libclc/generic/lib/atomic/atom_xor.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_xor.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_xor.h>
+#include <clc/opencl/atomic/atom_xor.h>
 
 #ifdef cl_khr_global_int32_extended_atomics
 #define __CLC_ATOMIC_OP xor
diff --git a/libclc/generic/lib/atomic/atomic_add.cl b/libclc/opencl/lib/generic/atomic/atomic_add.cl
similarity index 95%
rename from libclc/generic/lib/atomic/atomic_add.cl
rename to libclc/opencl/lib/generic/atomic/atomic_add.cl
index 0f8a7e1d98800..775f7a684e52d 100644
--- a/libclc/generic/lib/atomic/atomic_add.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_add.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #define IMPL(TYPE, AS) \
 _CLC_OVERLOAD _CLC_DEF TYPE atomic_add(volatile AS TYPE *p, TYPE val) { \
diff --git a/libclc/generic/lib/atomic/atomic_and.cl b/libclc/opencl/lib/generic/atomic/atomic_and.cl
similarity index 95%
rename from libclc/generic/lib/atomic/atomic_and.cl
rename to libclc/opencl/lib/generic/atomic/atomic_and.cl
index a151a8daf4645..eb99e551e7eea 100644
--- a/libclc/generic/lib/atomic/atomic_and.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_and.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #define IMPL(TYPE, AS) \
 _CLC_OVERLOAD _CLC_DEF TYPE atomic_and(volatile AS TYPE *p, TYPE val) { \
diff --git a/libclc/generic/lib/atomic/atomic_cmpxchg.cl b/libclc/opencl/lib/generic/atomic/atomic_cmpxchg.cl
similarity index 95%
rename from libclc/generic/lib/atomic/atomic_cmpxchg.cl
rename to libclc/opencl/lib/generic/atomic/atomic_cmpxchg.cl
index 0541007535ce9..44f40024e473d 100644
--- a/libclc/generic/lib/atomic/atomic_cmpxchg.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_cmpxchg.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #define IMPL(TYPE, AS) \
 _CLC_OVERLOAD _CLC_DEF TYPE atomic_cmpxchg(volatile AS TYPE *p, TYPE cmp, TYPE val) { \
diff --git a/libclc/generic/lib/atomic/atomic_dec.cl b/libclc/opencl/lib/generic/atomic/atomic_dec.cl
similarity index 95%
rename from libclc/generic/lib/atomic/atomic_dec.cl
rename to libclc/opencl/lib/generic/atomic/atomic_dec.cl
index 4ebfd11e8dff8..42e0ac28ecd0f 100644
--- a/libclc/generic/lib/atomic/atomic_dec.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_dec.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #define IMPL(TYPE, AS) \
 _CLC_OVERLOAD _CLC_DEF TYPE atomic_dec(volatile AS TYPE *p) { \
diff --git a/libclc/generic/lib/atomic/atomic_inc.cl b/libclc/opencl/lib/generic/atomic/atomic_inc.cl
similarity index 95%
rename from libclc/generic/lib/atomic/atomic_inc.cl
rename to libclc/opencl/lib/generic/atomic/atomic_inc.cl
index c9820fd4c78c4..d85c46a57d8e3 100644
--- a/libclc/generic/lib/atomic/atomic_inc.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_inc.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #define IMPL(TYPE, AS) \
 _CLC_OVERLOAD _CLC_DEF TYPE atomic_inc(volatile AS TYPE *p) { \
diff --git a/libclc/generic/lib/atomic/atomic_max.cl b/libclc/opencl/lib/generic/atomic/atomic_max.cl
similarity index 95%
rename from libclc/generic/lib/atomic/atomic_max.cl
rename to libclc/opencl/lib/generic/atomic/atomic_max.cl
index 698d8d713b7e1..b29ccc569295c 100644
--- a/libclc/generic/lib/atomic/atomic_max.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_max.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #define IMPL(TYPE, AS, OP) \
 _CLC_OVERLOAD _CLC_DEF TYPE atomic_max(volatile AS TYPE *p, TYPE val) { \
diff --git a/libclc/generic/lib/atomic/atomic_min.cl b/libclc/opencl/lib/generic/atomic/atomic_min.cl
similarity index 95%
rename from libclc/generic/lib/atomic/atomic_min.cl
rename to libclc/opencl/lib/generic/atomic/atomic_min.cl
index c0a7e3b92840a..a14595e453c71 100644
--- a/libclc/generic/lib/atomic/atomic_min.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_min.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #define IMPL(TYPE, AS, OP) \
 _CLC_OVERLOAD _CLC_DEF TYPE atomic_min(volatile AS TYPE *p, TYPE val) { \
diff --git a/libclc/generic/lib/atomic/atomic_or.cl b/libclc/opencl/lib/generic/atomic/atomic_or.cl
similarity index 95%
rename from libclc/generic/lib/atomic/atomic_or.cl
rename to libclc/opencl/lib/generic/atomic/atomic_or.cl
index 0ec0792703ff5..3b044c97cbd0a 100644
--- a/libclc/generic/lib/atomic/atomic_or.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_or.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #define IMPL(TYPE, AS) \
 _CLC_OVERLOAD _CLC_DEF TYPE atomic_or(volatile AS TYPE *p, TYPE val) { \
diff --git a/libclc/generic/lib/atomic/atomic_sub.cl b/libclc/opencl/lib/generic/atomic/atomic_sub.cl
similarity index 95%
rename from libclc/generic/lib/atomic/atomic_sub.cl
rename to libclc/opencl/lib/generic/atomic/atomic_sub.cl
index 8e43e8594558a..4588d9d9077a0 100644
--- a/libclc/generic/lib/atomic/atomic_sub.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_sub.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #define IMPL(TYPE, AS) \
 _CLC_OVERLOAD _CLC_DEF TYPE atomic_sub(volatile AS TYPE *p, TYPE val) { \
diff --git a/libclc/generic/lib/atomic/atomic_xchg.cl b/libclc/opencl/lib/generic/atomic/atomic_xchg.cl
similarity index 97%
rename from libclc/generic/lib/atomic/atomic_xchg.cl
rename to libclc/opencl/lib/generic/atomic/atomic_xchg.cl
index 464f23f08806f..ab4db17f00974 100644
--- a/libclc/generic/lib/atomic/atomic_xchg.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_xchg.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_OVERLOAD _CLC_DEF float atomic_xchg(volatile global float *p, float val) {
   return as_float(atomic_xchg((volatile global uint *)p, as_uint(val)));
diff --git a/libclc/generic/lib/atomic/atomic_xor.cl b/libclc/opencl/lib/generic/atomic/atomic_xor.cl
similarity index 95%
rename from libclc/generic/lib/atomic/atomic_xor.cl
rename to libclc/opencl/lib/generic/atomic/atomic_xor.cl
index b2f7594dd36e6..07e5b8bdefa00 100644
--- a/libclc/generic/lib/atomic/atomic_xor.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_xor.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #define IMPL(TYPE, AS) \
 _CLC_OVERLOAD _CLC_DEF TYPE atomic_xor(volatile AS TYPE *p, TYPE val) { \
diff --git a/libclc/generic/lib/common/degrees.cl b/libclc/opencl/lib/generic/common/degrees.cl
similarity index 96%
rename from libclc/generic/lib/common/degrees.cl
rename to libclc/opencl/lib/generic/common/degrees.cl
index a6e77457fd445..9d6c8ff3d3d43 100644
--- a/libclc/generic/lib/common/degrees.cl
+++ b/libclc/opencl/lib/generic/common/degrees.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/common/clc_degrees.h>
 
diff --git a/libclc/generic/lib/common/mix.cl b/libclc/opencl/lib/generic/common/mix.cl
similarity index 94%
rename from libclc/generic/lib/common/mix.cl
rename to libclc/opencl/lib/generic/common/mix.cl
index 5a365e073230b..b24cc27960cbf 100644
--- a/libclc/generic/lib/common/mix.cl
+++ b/libclc/opencl/lib/generic/common/mix.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_mad.h>
 
 #define __CLC_BODY <mix.inc>
diff --git a/libclc/generic/lib/common/mix.inc b/libclc/opencl/lib/generic/common/mix.inc
similarity index 100%
rename from libclc/generic/lib/common/mix.inc
rename to libclc/opencl/lib/generic/common/mix.inc
diff --git a/libclc/generic/lib/common/radians.cl b/libclc/opencl/lib/generic/common/radians.cl
similarity index 96%
rename from libclc/generic/lib/common/radians.cl
rename to libclc/opencl/lib/generic/common/radians.cl
index 17caa948939fb..67f7501652206 100644
--- a/libclc/generic/lib/common/radians.cl
+++ b/libclc/opencl/lib/generic/common/radians.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/common/clc_radians.h>
 
diff --git a/libclc/generic/lib/common/sign.cl b/libclc/opencl/lib/generic/common/sign.cl
similarity index 94%
rename from libclc/generic/lib/common/sign.cl
rename to libclc/opencl/lib/generic/common/sign.cl
index b33cdac3001d3..38fa9270bf481 100644
--- a/libclc/generic/lib/common/sign.cl
+++ b/libclc/opencl/lib/generic/common/sign.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/common/clc_sign.h>
 
diff --git a/libclc/generic/lib/common/smoothstep.cl b/libclc/opencl/lib/generic/common/smoothstep.cl
similarity index 99%
rename from libclc/generic/lib/common/smoothstep.cl
rename to libclc/opencl/lib/generic/common/smoothstep.cl
index 16bf1b2ce9522..8bea015e7dc8f 100644
--- a/libclc/generic/lib/common/smoothstep.cl
+++ b/libclc/opencl/lib/generic/common/smoothstep.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/common/clc_smoothstep.h>
 
diff --git a/libclc/generic/lib/common/step.cl b/libclc/opencl/lib/generic/common/step.cl
similarity index 97%
rename from libclc/generic/lib/common/step.cl
rename to libclc/opencl/lib/generic/common/step.cl
index 4bf1166245773..581f83c2fc37f 100644
--- a/libclc/generic/lib/common/step.cl
+++ b/libclc/opencl/lib/generic/common/step.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 
 _CLC_OVERLOAD _CLC_DEF float step(float edge, float x) {
diff --git a/libclc/generic/lib/geometric/cross.cl b/libclc/opencl/lib/generic/geometric/cross.cl
similarity index 97%
rename from libclc/generic/lib/geometric/cross.cl
rename to libclc/opencl/lib/generic/geometric/cross.cl
index 842670bb3e808..ce16fadacaae8 100644
--- a/libclc/generic/lib/geometric/cross.cl
+++ b/libclc/opencl/lib/generic/geometric/cross.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/geometric/clc_cross.h>
 
 _CLC_OVERLOAD _CLC_DEF float3 cross(float3 p0, float3 p1) {
diff --git a/libclc/generic/lib/geometric/distance.cl b/libclc/opencl/lib/generic/geometric/distance.cl
similarity index 94%
rename from libclc/generic/lib/geometric/distance.cl
rename to libclc/opencl/lib/generic/geometric/distance.cl
index 2416ad1352aaf..dfe0ed5bd0fed 100644
--- a/libclc/generic/lib/geometric/distance.cl
+++ b/libclc/opencl/lib/generic/geometric/distance.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/geometric/clc_distance.h>
 
 #define FUNCTION distance
diff --git a/libclc/generic/lib/geometric/dot.cl b/libclc/opencl/lib/generic/geometric/dot.cl
similarity index 98%
rename from libclc/generic/lib/geometric/dot.cl
rename to libclc/opencl/lib/generic/geometric/dot.cl
index 60469c94d47b3..26b67c35a9cef 100644
--- a/libclc/generic/lib/geometric/dot.cl
+++ b/libclc/opencl/lib/generic/geometric/dot.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/geometric/clc_dot.h>
 
 _CLC_OVERLOAD _CLC_DEF float dot(float p0, float p1) {
diff --git a/libclc/generic/lib/geometric/fast_distance.cl b/libclc/opencl/lib/generic/geometric/fast_distance.cl
similarity index 95%
rename from libclc/generic/lib/geometric/fast_distance.cl
rename to libclc/opencl/lib/generic/geometric/fast_distance.cl
index 589c79496506e..2f2931184a6c3 100644
--- a/libclc/generic/lib/geometric/fast_distance.cl
+++ b/libclc/opencl/lib/generic/geometric/fast_distance.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/geometric/clc_fast_distance.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/geometric/fast_length.cl b/libclc/opencl/lib/generic/geometric/fast_length.cl
similarity index 95%
rename from libclc/generic/lib/geometric/fast_length.cl
rename to libclc/opencl/lib/generic/geometric/fast_length.cl
index 11e8172998053..45c8e7596cf67 100644
--- a/libclc/generic/lib/geometric/fast_length.cl
+++ b/libclc/opencl/lib/generic/geometric/fast_length.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/geometric/clc_fast_length.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/geometric/fast_normalize.cl b/libclc/opencl/lib/generic/geometric/fast_normalize.cl
similarity index 95%
rename from libclc/generic/lib/geometric/fast_normalize.cl
rename to libclc/opencl/lib/generic/geometric/fast_normalize.cl
index 585400d2200fd..8701170d54e76 100644
--- a/libclc/generic/lib/geometric/fast_normalize.cl
+++ b/libclc/opencl/lib/generic/geometric/fast_normalize.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_OVERLOAD _CLC_DEF float fast_normalize(float p) {
   return normalize(p);
diff --git a/libclc/generic/lib/geometric/fast_normalize.inc b/libclc/opencl/lib/generic/geometric/fast_normalize.inc
similarity index 100%
rename from libclc/generic/lib/geometric/fast_normalize.inc
rename to libclc/opencl/lib/generic/geometric/fast_normalize.inc
diff --git a/libclc/generic/lib/geometric/length.cl b/libclc/opencl/lib/generic/geometric/length.cl
similarity index 94%
rename from libclc/generic/lib/geometric/length.cl
rename to libclc/opencl/lib/generic/geometric/length.cl
index 3a4e286e9a0fb..cb4aa5a812f34 100644
--- a/libclc/generic/lib/geometric/length.cl
+++ b/libclc/opencl/lib/generic/geometric/length.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/geometric/clc_length.h>
 
 #define FUNCTION length
diff --git a/libclc/generic/lib/geometric/normalize.cl b/libclc/opencl/lib/generic/geometric/normalize.cl
similarity index 99%
rename from libclc/generic/lib/geometric/normalize.cl
rename to libclc/opencl/lib/generic/geometric/normalize.cl
index 36c1f64687536..14c43cbd64099 100644
--- a/libclc/generic/lib/geometric/normalize.cl
+++ b/libclc/opencl/lib/generic/geometric/normalize.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_OVERLOAD _CLC_DEF float normalize(float p) {
   return sign(p);
diff --git a/libclc/generic/lib/integer/abs.cl b/libclc/opencl/lib/generic/integer/abs.cl
similarity index 94%
rename from libclc/generic/lib/integer/abs.cl
rename to libclc/opencl/lib/generic/integer/abs.cl
index 7a7aa32e27844..ca1435c58e98e 100644
--- a/libclc/generic/lib/integer/abs.cl
+++ b/libclc/opencl/lib/generic/integer/abs.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/integer/clc_abs.h>
 
 #define __CLC_BODY <abs.inc>
diff --git a/libclc/generic/lib/integer/abs.inc b/libclc/opencl/lib/generic/integer/abs.inc
similarity index 100%
rename from libclc/generic/lib/integer/abs.inc
rename to libclc/opencl/lib/generic/integer/abs.inc
diff --git a/libclc/generic/lib/integer/abs_diff.cl b/libclc/opencl/lib/generic/integer/abs_diff.cl
similarity index 94%
rename from libclc/generic/lib/integer/abs_diff.cl
rename to libclc/opencl/lib/generic/integer/abs_diff.cl
index 552f61e1d1ae6..17efdc2e9eb25 100644
--- a/libclc/generic/lib/integer/abs_diff.cl
+++ b/libclc/opencl/lib/generic/integer/abs_diff.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/integer/clc_abs_diff.h>
 
 #define __CLC_BODY <abs_diff.inc>
diff --git a/libclc/generic/lib/integer/abs_diff.inc b/libclc/opencl/lib/generic/integer/abs_diff.inc
similarity index 100%
rename from libclc/generic/lib/integer/abs_diff.inc
rename to libclc/opencl/lib/generic/integer/abs_diff.inc
diff --git a/libclc/generic/lib/integer/add_sat.cl b/libclc/opencl/lib/generic/integer/add_sat.cl
similarity index 94%
rename from libclc/generic/lib/integer/add_sat.cl
rename to libclc/opencl/lib/generic/integer/add_sat.cl
index 080cc6d57f7d6..1d46cc9a97c30 100644
--- a/libclc/generic/lib/integer/add_sat.cl
+++ b/libclc/opencl/lib/generic/integer/add_sat.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/integer/clc_add_sat.h>
 
 #define FUNCTION add_sat
diff --git a/libclc/generic/lib/integer/clz.cl b/libclc/opencl/lib/generic/integer/clz.cl
similarity index 94%
rename from libclc/generic/lib/integer/clz.cl
rename to libclc/opencl/lib/generic/integer/clz.cl
index bc2e7e2a29129..7c4ba975a7d3d 100644
--- a/libclc/generic/lib/integer/clz.cl
+++ b/libclc/opencl/lib/generic/integer/clz.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/integer/clc_clz.h>
 
 #define FUNCTION clz
diff --git a/libclc/generic/lib/integer/ctz.cl b/libclc/opencl/lib/generic/integer/ctz.cl
similarity index 95%
rename from libclc/generic/lib/integer/ctz.cl
rename to libclc/opencl/lib/generic/integer/ctz.cl
index 44978e1617403..5bf32a76266cb 100644
--- a/libclc/generic/lib/integer/ctz.cl
+++ b/libclc/opencl/lib/generic/integer/ctz.cl
@@ -8,7 +8,7 @@
 
 #if __OPENCL_C_VERSION__ >= CL_VERSION_2_0
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/integer/clc_ctz.h>
 
 #define FUNCTION ctz
diff --git a/libclc/generic/lib/integer/hadd.cl b/libclc/opencl/lib/generic/integer/hadd.cl
similarity index 94%
rename from libclc/generic/lib/integer/hadd.cl
rename to libclc/opencl/lib/generic/integer/hadd.cl
index b89e17463f07c..037f5c3328d9f 100644
--- a/libclc/generic/lib/integer/hadd.cl
+++ b/libclc/opencl/lib/generic/integer/hadd.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/integer/clc_hadd.h>
 
 #define FUNCTION hadd
diff --git a/libclc/generic/lib/integer/mad24.cl b/libclc/opencl/lib/generic/integer/mad24.cl
similarity index 94%
rename from libclc/generic/lib/integer/mad24.cl
rename to libclc/opencl/lib/generic/integer/mad24.cl
index 59aea1baa33b7..15afc98433287 100644
--- a/libclc/generic/lib/integer/mad24.cl
+++ b/libclc/opencl/lib/generic/integer/mad24.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/integer/clc_mad24.h>
 
 #define FUNCTION mad24
diff --git a/libclc/generic/lib/integer/mad_hi.cl b/libclc/opencl/lib/generic/integer/mad_hi.cl
similarity index 94%
rename from libclc/generic/lib/integer/mad_hi.cl
rename to libclc/opencl/lib/generic/integer/mad_hi.cl
index 5fa3a44ea4ee0..53070937c1682 100644
--- a/libclc/generic/lib/integer/mad_hi.cl
+++ b/libclc/opencl/lib/generic/integer/mad_hi.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/integer/clc_mad_hi.h>
 
 #define FUNCTION mad_hi
diff --git a/libclc/generic/lib/integer/mad_sat.cl b/libclc/opencl/lib/generic/integer/mad_sat.cl
similarity index 94%
rename from libclc/generic/lib/integer/mad_sat.cl
rename to libclc/opencl/lib/generic/integer/mad_sat.cl
index d7a933313700a..f083a90815f6c 100644
--- a/libclc/generic/lib/integer/mad_sat.cl
+++ b/libclc/opencl/lib/generic/integer/mad_sat.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/integer/clc_mad_sat.h>
 
 #define FUNCTION mad_sat
diff --git a/libclc/generic/lib/integer/mul24.cl b/libclc/opencl/lib/generic/integer/mul24.cl
similarity index 94%
rename from libclc/generic/lib/integer/mul24.cl
rename to libclc/opencl/lib/generic/integer/mul24.cl
index ec32ada5d6c67..b538ae11f5e8a 100644
--- a/libclc/generic/lib/integer/mul24.cl
+++ b/libclc/opencl/lib/generic/integer/mul24.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/integer/clc_mul24.h>
 
 #define FUNCTION mul24
diff --git a/libclc/generic/lib/integer/mul_hi.cl b/libclc/opencl/lib/generic/integer/mul_hi.cl
similarity index 94%
rename from libclc/generic/lib/integer/mul_hi.cl
rename to libclc/opencl/lib/generic/integer/mul_hi.cl
index 152bc3fa72c9a..8fb0d11db0ec9 100644
--- a/libclc/generic/lib/integer/mul_hi.cl
+++ b/libclc/opencl/lib/generic/integer/mul_hi.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/integer/clc_mul_hi.h>
 
 #define FUNCTION mul_hi
diff --git a/libclc/generic/lib/integer/popcount.cl b/libclc/opencl/lib/generic/integer/popcount.cl
similarity index 94%
rename from libclc/generic/lib/integer/popcount.cl
rename to libclc/opencl/lib/generic/integer/popcount.cl
index 35f57f50c8015..ae54980c20b66 100644
--- a/libclc/generic/lib/integer/popcount.cl
+++ b/libclc/opencl/lib/generic/integer/popcount.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/integer/clc_popcount.h>
 
 #define FUNCTION popcount
diff --git a/libclc/generic/lib/integer/rhadd.cl b/libclc/opencl/lib/generic/integer/rhadd.cl
similarity index 94%
rename from libclc/generic/lib/integer/rhadd.cl
rename to libclc/opencl/lib/generic/integer/rhadd.cl
index 86d3286658b40..b8dcbb6207155 100644
--- a/libclc/generic/lib/integer/rhadd.cl
+++ b/libclc/opencl/lib/generic/integer/rhadd.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/integer/clc_rhadd.h>
 
 #define FUNCTION rhadd
diff --git a/libclc/generic/lib/integer/rotate.cl b/libclc/opencl/lib/generic/integer/rotate.cl
similarity index 94%
rename from libclc/generic/lib/integer/rotate.cl
rename to libclc/opencl/lib/generic/integer/rotate.cl
index 8de40e84e24fa..64eead06707d5 100644
--- a/libclc/generic/lib/integer/rotate.cl
+++ b/libclc/opencl/lib/generic/integer/rotate.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/integer/clc_rotate.h>
 
 #define FUNCTION rotate
diff --git a/libclc/generic/lib/integer/sub_sat.cl b/libclc/opencl/lib/generic/integer/sub_sat.cl
similarity index 94%
rename from libclc/generic/lib/integer/sub_sat.cl
rename to libclc/opencl/lib/generic/integer/sub_sat.cl
index 7938376acb5a9..9df2e44ecb78d 100644
--- a/libclc/generic/lib/integer/sub_sat.cl
+++ b/libclc/opencl/lib/generic/integer/sub_sat.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/integer/clc_sub_sat.h>
 
 #define FUNCTION sub_sat
diff --git a/libclc/generic/lib/integer/upsample.cl b/libclc/opencl/lib/generic/integer/upsample.cl
similarity index 98%
rename from libclc/generic/lib/integer/upsample.cl
rename to libclc/opencl/lib/generic/integer/upsample.cl
index 46831f5db2afb..c148e9a8b522b 100644
--- a/libclc/generic/lib/integer/upsample.cl
+++ b/libclc/opencl/lib/generic/integer/upsample.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/integer/clc_upsample.h>
 
 #define __CLC_UPSAMPLE_IMPL(BGENTYPE, GENTYPE, UGENTYPE)                       \
diff --git a/libclc/generic/lib/math/acos.cl b/libclc/opencl/lib/generic/math/acos.cl
similarity index 94%
rename from libclc/generic/lib/math/acos.cl
rename to libclc/opencl/lib/generic/math/acos.cl
index 85119b437b4cd..37d9a717b06c3 100644
--- a/libclc/generic/lib/math/acos.cl
+++ b/libclc/opencl/lib/generic/math/acos.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_acos.h>
 
 #define FUNCTION acos
diff --git a/libclc/generic/lib/math/acosh.cl b/libclc/opencl/lib/generic/math/acosh.cl
similarity index 94%
rename from libclc/generic/lib/math/acosh.cl
rename to libclc/opencl/lib/generic/math/acosh.cl
index 7df6b87703f5f..bdef0b9aafa53 100644
--- a/libclc/generic/lib/math/acosh.cl
+++ b/libclc/opencl/lib/generic/math/acosh.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_acosh.h>
 
 #define FUNCTION acosh
diff --git a/libclc/generic/lib/math/acospi.cl b/libclc/opencl/lib/generic/math/acospi.cl
similarity index 94%
rename from libclc/generic/lib/math/acospi.cl
rename to libclc/opencl/lib/generic/math/acospi.cl
index d8e774481d412..138d59aee7317 100644
--- a/libclc/generic/lib/math/acospi.cl
+++ b/libclc/opencl/lib/generic/math/acospi.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_acospi.h>
 
 #define FUNCTION acospi
diff --git a/libclc/generic/lib/math/asin.cl b/libclc/opencl/lib/generic/math/asin.cl
similarity index 94%
rename from libclc/generic/lib/math/asin.cl
rename to libclc/opencl/lib/generic/math/asin.cl
index 58e4b7440d6f3..3f3247000bfa7 100644
--- a/libclc/generic/lib/math/asin.cl
+++ b/libclc/opencl/lib/generic/math/asin.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_asin.h>
 
 #define FUNCTION asin
diff --git a/libclc/generic/lib/math/asinh.cl b/libclc/opencl/lib/generic/math/asinh.cl
similarity index 94%
rename from libclc/generic/lib/math/asinh.cl
rename to libclc/opencl/lib/generic/math/asinh.cl
index 84ba61d052b8f..48f7c273d460f 100644
--- a/libclc/generic/lib/math/asinh.cl
+++ b/libclc/opencl/lib/generic/math/asinh.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_asinh.h>
 
 #define FUNCTION asinh
diff --git a/libclc/generic/lib/math/asinpi.cl b/libclc/opencl/lib/generic/math/asinpi.cl
similarity index 94%
rename from libclc/generic/lib/math/asinpi.cl
rename to libclc/opencl/lib/generic/math/asinpi.cl
index bf232ef89e606..7d80a3f5f6d99 100644
--- a/libclc/generic/lib/math/asinpi.cl
+++ b/libclc/opencl/lib/generic/math/asinpi.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_asinpi.h>
 
 #define FUNCTION asinpi
diff --git a/libclc/generic/lib/math/atan.cl b/libclc/opencl/lib/generic/math/atan.cl
similarity index 94%
rename from libclc/generic/lib/math/atan.cl
rename to libclc/opencl/lib/generic/math/atan.cl
index b0a466aee5e14..13674753fb014 100644
--- a/libclc/generic/lib/math/atan.cl
+++ b/libclc/opencl/lib/generic/math/atan.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_atan.h>
 
 #define FUNCTION atan
diff --git a/libclc/generic/lib/math/atan2.cl b/libclc/opencl/lib/generic/math/atan2.cl
similarity index 95%
rename from libclc/generic/lib/math/atan2.cl
rename to libclc/opencl/lib/generic/math/atan2.cl
index 20651c1ec1bf3..748438e4734f4 100644
--- a/libclc/generic/lib/math/atan2.cl
+++ b/libclc/opencl/lib/generic/math/atan2.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_atan2.h>
 
diff --git a/libclc/generic/lib/math/atan2pi.cl b/libclc/opencl/lib/generic/math/atan2pi.cl
similarity index 95%
rename from libclc/generic/lib/math/atan2pi.cl
rename to libclc/opencl/lib/generic/math/atan2pi.cl
index 316db1d6c9c48..9a326aa689df2 100644
--- a/libclc/generic/lib/math/atan2pi.cl
+++ b/libclc/opencl/lib/generic/math/atan2pi.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_atan2pi.h>
 
diff --git a/libclc/generic/lib/math/atanh.cl b/libclc/opencl/lib/generic/math/atanh.cl
similarity index 94%
rename from libclc/generic/lib/math/atanh.cl
rename to libclc/opencl/lib/generic/math/atanh.cl
index 5d92cdbd2adf6..075297b58228f 100644
--- a/libclc/generic/lib/math/atanh.cl
+++ b/libclc/opencl/lib/generic/math/atanh.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_atanh.h>
 
 #define FUNCTION atanh
diff --git a/libclc/generic/lib/math/atanpi.cl b/libclc/opencl/lib/generic/math/atanpi.cl
similarity index 94%
rename from libclc/generic/lib/math/atanpi.cl
rename to libclc/opencl/lib/generic/math/atanpi.cl
index 4337bdf3f660c..9451058b45b90 100644
--- a/libclc/generic/lib/math/atanpi.cl
+++ b/libclc/opencl/lib/generic/math/atanpi.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_atanpi.h>
 
 #define FUNCTION atanpi
diff --git a/libclc/generic/lib/math/cbrt.cl b/libclc/opencl/lib/generic/math/cbrt.cl
similarity index 94%
rename from libclc/generic/lib/math/cbrt.cl
rename to libclc/opencl/lib/generic/math/cbrt.cl
index 4bd5efd4ef7c0..4eadcf8a9421f 100644
--- a/libclc/generic/lib/math/cbrt.cl
+++ b/libclc/opencl/lib/generic/math/cbrt.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_cbrt.inc>
 
 #define FUNCTION cbrt
diff --git a/libclc/generic/lib/math/ceil.cl b/libclc/opencl/lib/generic/math/ceil.cl
similarity index 94%
rename from libclc/generic/lib/math/ceil.cl
rename to libclc/opencl/lib/generic/math/ceil.cl
index 00635dcb5507a..52c5fd05daa04 100644
--- a/libclc/generic/lib/math/ceil.cl
+++ b/libclc/opencl/lib/generic/math/ceil.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_ceil.h>
 
 #define FUNCTION ceil
diff --git a/libclc/generic/lib/math/copysign.cl b/libclc/opencl/lib/generic/math/copysign.cl
similarity index 94%
rename from libclc/generic/lib/math/copysign.cl
rename to libclc/opencl/lib/generic/math/copysign.cl
index e38aa035d7bf9..eb6b1100d2b54 100644
--- a/libclc/generic/lib/math/copysign.cl
+++ b/libclc/opencl/lib/generic/math/copysign.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_copysign.h>
 
 #define FUNCTION copysign
diff --git a/libclc/generic/lib/math/cos.cl b/libclc/opencl/lib/generic/math/cos.cl
similarity index 94%
rename from libclc/generic/lib/math/cos.cl
rename to libclc/opencl/lib/generic/math/cos.cl
index 5b97c6a6f379a..ba1e541ed0a95 100644
--- a/libclc/generic/lib/math/cos.cl
+++ b/libclc/opencl/lib/generic/math/cos.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_cos.h>
 
 #define FUNCTION cos
diff --git a/libclc/generic/lib/math/cosh.cl b/libclc/opencl/lib/generic/math/cosh.cl
similarity index 94%
rename from libclc/generic/lib/math/cosh.cl
rename to libclc/opencl/lib/generic/math/cosh.cl
index 870c56029f338..2945b992482bb 100644
--- a/libclc/generic/lib/math/cosh.cl
+++ b/libclc/opencl/lib/generic/math/cosh.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_cosh.h>
 
 #define FUNCTION cosh
diff --git a/libclc/generic/lib/math/cospi.cl b/libclc/opencl/lib/generic/math/cospi.cl
similarity index 94%
rename from libclc/generic/lib/math/cospi.cl
rename to libclc/opencl/lib/generic/math/cospi.cl
index f78935664c65b..3737716d4960c 100644
--- a/libclc/generic/lib/math/cospi.cl
+++ b/libclc/opencl/lib/generic/math/cospi.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_cospi.h>
 
 #define FUNCTION cospi
diff --git a/libclc/generic/lib/math/erf.cl b/libclc/opencl/lib/generic/math/erf.cl
similarity index 94%
rename from libclc/generic/lib/math/erf.cl
rename to libclc/opencl/lib/generic/math/erf.cl
index 78c34fe0188f2..f0ef39fbdd4fd 100644
--- a/libclc/generic/lib/math/erf.cl
+++ b/libclc/opencl/lib/generic/math/erf.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_erf.h>
 
 #define FUNCTION erf
diff --git a/libclc/generic/lib/math/erfc.cl b/libclc/opencl/lib/generic/math/erfc.cl
similarity index 94%
rename from libclc/generic/lib/math/erfc.cl
rename to libclc/opencl/lib/generic/math/erfc.cl
index 84d578611012b..318c0ca3c3937 100644
--- a/libclc/generic/lib/math/erfc.cl
+++ b/libclc/opencl/lib/generic/math/erfc.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_erfc.h>
 
 #define FUNCTION erfc
diff --git a/libclc/generic/lib/math/exp.cl b/libclc/opencl/lib/generic/math/exp.cl
similarity index 94%
rename from libclc/generic/lib/math/exp.cl
rename to libclc/opencl/lib/generic/math/exp.cl
index cebd630e52ab7..efbed2298e429 100644
--- a/libclc/generic/lib/math/exp.cl
+++ b/libclc/opencl/lib/generic/math/exp.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_exp.h>
 
 #define FUNCTION exp
diff --git a/libclc/generic/lib/math/exp10.cl b/libclc/opencl/lib/generic/math/exp10.cl
similarity index 94%
rename from libclc/generic/lib/math/exp10.cl
rename to libclc/opencl/lib/generic/math/exp10.cl
index 79544b26fa539..cf0e1a58206bd 100644
--- a/libclc/generic/lib/math/exp10.cl
+++ b/libclc/opencl/lib/generic/math/exp10.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_exp10.h>
 
 #define FUNCTION exp10
diff --git a/libclc/generic/lib/math/exp2.cl b/libclc/opencl/lib/generic/math/exp2.cl
similarity index 94%
rename from libclc/generic/lib/math/exp2.cl
rename to libclc/opencl/lib/generic/math/exp2.cl
index 465c39174a734..3618f56e32558 100644
--- a/libclc/generic/lib/math/exp2.cl
+++ b/libclc/opencl/lib/generic/math/exp2.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_exp2.h>
 
 #define FUNCTION exp2
diff --git a/libclc/generic/lib/math/expm1.cl b/libclc/opencl/lib/generic/math/expm1.cl
similarity index 94%
rename from libclc/generic/lib/math/expm1.cl
rename to libclc/opencl/lib/generic/math/expm1.cl
index b4eed66d692b4..26aa2932a4542 100644
--- a/libclc/generic/lib/math/expm1.cl
+++ b/libclc/opencl/lib/generic/math/expm1.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_expm1.h>
 
 #define FUNCTION expm1
diff --git a/libclc/generic/lib/math/fabs.cl b/libclc/opencl/lib/generic/math/fabs.cl
similarity index 94%
rename from libclc/generic/lib/math/fabs.cl
rename to libclc/opencl/lib/generic/math/fabs.cl
index 2723fae8b05c5..461b9a56d31c4 100644
--- a/libclc/generic/lib/math/fabs.cl
+++ b/libclc/opencl/lib/generic/math/fabs.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_fabs.h>
 
 #define FUNCTION fabs
diff --git a/libclc/generic/lib/math/fdim.cl b/libclc/opencl/lib/generic/math/fdim.cl
similarity index 94%
rename from libclc/generic/lib/math/fdim.cl
rename to libclc/opencl/lib/generic/math/fdim.cl
index dc078d42fd591..f901c6010a47b 100644
--- a/libclc/generic/lib/math/fdim.cl
+++ b/libclc/opencl/lib/generic/math/fdim.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_fdim.h>
 
 #define FUNCTION fdim
diff --git a/libclc/generic/lib/math/floor.cl b/libclc/opencl/lib/generic/math/floor.cl
similarity index 94%
rename from libclc/generic/lib/math/floor.cl
rename to libclc/opencl/lib/generic/math/floor.cl
index d74a50d3a22ac..6cad3b3335e9a 100644
--- a/libclc/generic/lib/math/floor.cl
+++ b/libclc/opencl/lib/generic/math/floor.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_floor.h>
 
 #define FUNCTION floor
diff --git a/libclc/generic/lib/math/fma.cl b/libclc/opencl/lib/generic/math/fma.cl
similarity index 96%
rename from libclc/generic/lib/math/fma.cl
rename to libclc/opencl/lib/generic/math/fma.cl
index db162e1e417d8..0c43d2b028dae 100644
--- a/libclc/generic/lib/math/fma.cl
+++ b/libclc/opencl/lib/generic/math/fma.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_fma.h>
 #include <clc/math/math.h>
diff --git a/libclc/generic/lib/math/fmax.cl b/libclc/opencl/lib/generic/math/fmax.cl
similarity index 94%
rename from libclc/generic/lib/math/fmax.cl
rename to libclc/opencl/lib/generic/math/fmax.cl
index 6ad5901eab739..ff06226b33617 100644
--- a/libclc/generic/lib/math/fmax.cl
+++ b/libclc/opencl/lib/generic/math/fmax.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_fmax.h>
 
 #define FUNCTION fmax
diff --git a/libclc/generic/lib/math/fmax.inc b/libclc/opencl/lib/generic/math/fmax.inc
similarity index 100%
rename from libclc/generic/lib/math/fmax.inc
rename to libclc/opencl/lib/generic/math/fmax.inc
diff --git a/libclc/generic/lib/math/fmin.cl b/libclc/opencl/lib/generic/math/fmin.cl
similarity index 94%
rename from libclc/generic/lib/math/fmin.cl
rename to libclc/opencl/lib/generic/math/fmin.cl
index bb42a2a6d647d..9a6f0f79f4f2c 100644
--- a/libclc/generic/lib/math/fmin.cl
+++ b/libclc/opencl/lib/generic/math/fmin.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_fmin.h>
 
 #define FUNCTION fmin
diff --git a/libclc/generic/lib/math/fmin.inc b/libclc/opencl/lib/generic/math/fmin.inc
similarity index 100%
rename from libclc/generic/lib/math/fmin.inc
rename to libclc/opencl/lib/generic/math/fmin.inc
diff --git a/libclc/generic/lib/math/fmod.cl b/libclc/opencl/lib/generic/math/fmod.cl
similarity index 94%
rename from libclc/generic/lib/math/fmod.cl
rename to libclc/opencl/lib/generic/math/fmod.cl
index 07f880486c0f6..59d90c77fb62b 100644
--- a/libclc/generic/lib/math/fmod.cl
+++ b/libclc/opencl/lib/generic/math/fmod.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_fmod.h>
 
 #define FUNCTION fmod
diff --git a/libclc/generic/lib/math/fract.cl b/libclc/opencl/lib/generic/math/fract.cl
similarity index 94%
rename from libclc/generic/lib/math/fract.cl
rename to libclc/opencl/lib/generic/math/fract.cl
index 54a2cf8411665..43f164fff312f 100644
--- a/libclc/generic/lib/math/fract.cl
+++ b/libclc/opencl/lib/generic/math/fract.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_fract.h>
 
 #define FUNCTION fract
diff --git a/libclc/generic/lib/math/frexp.cl b/libclc/opencl/lib/generic/math/frexp.cl
similarity index 94%
rename from libclc/generic/lib/math/frexp.cl
rename to libclc/opencl/lib/generic/math/frexp.cl
index 355e284524fa4..77c87467b7937 100644
--- a/libclc/generic/lib/math/frexp.cl
+++ b/libclc/opencl/lib/generic/math/frexp.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_frexp.h>
 
 #define FUNCTION frexp
diff --git a/libclc/generic/lib/math/half_cos.cl b/libclc/opencl/lib/generic/math/half_cos.cl
similarity index 95%
rename from libclc/generic/lib/math/half_cos.cl
rename to libclc/opencl/lib/generic/math/half_cos.cl
index 1e49ebe8ce73a..9665626ecccd5 100644
--- a/libclc/generic/lib/math/half_cos.cl
+++ b/libclc/opencl/lib/generic/math/half_cos.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_cos.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/half_divide.cl b/libclc/opencl/lib/generic/math/half_divide.cl
similarity index 95%
rename from libclc/generic/lib/math/half_divide.cl
rename to libclc/opencl/lib/generic/math/half_divide.cl
index 29b5679f428e0..0c7519b346240 100644
--- a/libclc/generic/lib/math/half_divide.cl
+++ b/libclc/opencl/lib/generic/math/half_divide.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_divide.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/half_exp.cl b/libclc/opencl/lib/generic/math/half_exp.cl
similarity index 95%
rename from libclc/generic/lib/math/half_exp.cl
rename to libclc/opencl/lib/generic/math/half_exp.cl
index 219b262190104..be356775852b3 100644
--- a/libclc/generic/lib/math/half_exp.cl
+++ b/libclc/opencl/lib/generic/math/half_exp.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_exp.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/half_exp10.cl b/libclc/opencl/lib/generic/math/half_exp10.cl
similarity index 95%
rename from libclc/generic/lib/math/half_exp10.cl
rename to libclc/opencl/lib/generic/math/half_exp10.cl
index 64132c0f93988..e47d955a449e9 100644
--- a/libclc/generic/lib/math/half_exp10.cl
+++ b/libclc/opencl/lib/generic/math/half_exp10.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_exp10.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/half_exp2.cl b/libclc/opencl/lib/generic/math/half_exp2.cl
similarity index 95%
rename from libclc/generic/lib/math/half_exp2.cl
rename to libclc/opencl/lib/generic/math/half_exp2.cl
index 9fddc5eb096eb..100bc02982df4 100644
--- a/libclc/generic/lib/math/half_exp2.cl
+++ b/libclc/opencl/lib/generic/math/half_exp2.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_exp2.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/half_log.cl b/libclc/opencl/lib/generic/math/half_log.cl
similarity index 95%
rename from libclc/generic/lib/math/half_log.cl
rename to libclc/opencl/lib/generic/math/half_log.cl
index b3d2c27117763..b417a800b0e15 100644
--- a/libclc/generic/lib/math/half_log.cl
+++ b/libclc/opencl/lib/generic/math/half_log.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_log.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/half_log10.cl b/libclc/opencl/lib/generic/math/half_log10.cl
similarity index 95%
rename from libclc/generic/lib/math/half_log10.cl
rename to libclc/opencl/lib/generic/math/half_log10.cl
index 8ef6d463b3f97..974e4b899cb72 100644
--- a/libclc/generic/lib/math/half_log10.cl
+++ b/libclc/opencl/lib/generic/math/half_log10.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_log10.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/half_log2.cl b/libclc/opencl/lib/generic/math/half_log2.cl
similarity index 95%
rename from libclc/generic/lib/math/half_log2.cl
rename to libclc/opencl/lib/generic/math/half_log2.cl
index a343dbae36d7b..4e21d8f907757 100644
--- a/libclc/generic/lib/math/half_log2.cl
+++ b/libclc/opencl/lib/generic/math/half_log2.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_log2.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/half_powr.cl b/libclc/opencl/lib/generic/math/half_powr.cl
similarity index 95%
rename from libclc/generic/lib/math/half_powr.cl
rename to libclc/opencl/lib/generic/math/half_powr.cl
index 03c4ca7a01775..9b745313ce3cb 100644
--- a/libclc/generic/lib/math/half_powr.cl
+++ b/libclc/opencl/lib/generic/math/half_powr.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_powr.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/half_recip.cl b/libclc/opencl/lib/generic/math/half_recip.cl
similarity index 95%
rename from libclc/generic/lib/math/half_recip.cl
rename to libclc/opencl/lib/generic/math/half_recip.cl
index 70f7625c43f5c..9f0df658d81ba 100644
--- a/libclc/generic/lib/math/half_recip.cl
+++ b/libclc/opencl/lib/generic/math/half_recip.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_recip.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/half_rsqrt.cl b/libclc/opencl/lib/generic/math/half_rsqrt.cl
similarity index 95%
rename from libclc/generic/lib/math/half_rsqrt.cl
rename to libclc/opencl/lib/generic/math/half_rsqrt.cl
index 3fc788d80906a..a4ea9100add20 100644
--- a/libclc/generic/lib/math/half_rsqrt.cl
+++ b/libclc/opencl/lib/generic/math/half_rsqrt.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_rsqrt.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/half_sin.cl b/libclc/opencl/lib/generic/math/half_sin.cl
similarity index 95%
rename from libclc/generic/lib/math/half_sin.cl
rename to libclc/opencl/lib/generic/math/half_sin.cl
index 6fab611610fb0..0756c54287e4d 100644
--- a/libclc/generic/lib/math/half_sin.cl
+++ b/libclc/opencl/lib/generic/math/half_sin.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_sin.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/half_sqrt.cl b/libclc/opencl/lib/generic/math/half_sqrt.cl
similarity index 95%
rename from libclc/generic/lib/math/half_sqrt.cl
rename to libclc/opencl/lib/generic/math/half_sqrt.cl
index e96e127a89b3e..654a1ff12cffd 100644
--- a/libclc/generic/lib/math/half_sqrt.cl
+++ b/libclc/opencl/lib/generic/math/half_sqrt.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_sqrt.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/half_tan.cl b/libclc/opencl/lib/generic/math/half_tan.cl
similarity index 95%
rename from libclc/generic/lib/math/half_tan.cl
rename to libclc/opencl/lib/generic/math/half_tan.cl
index ddfcfae4ff994..d9c60576e69ac 100644
--- a/libclc/generic/lib/math/half_tan.cl
+++ b/libclc/opencl/lib/generic/math/half_tan.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_tan.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/hypot.cl b/libclc/opencl/lib/generic/math/hypot.cl
similarity index 94%
rename from libclc/generic/lib/math/hypot.cl
rename to libclc/opencl/lib/generic/math/hypot.cl
index ff95bd20f6d48..c96e9243c99a4 100644
--- a/libclc/generic/lib/math/hypot.cl
+++ b/libclc/opencl/lib/generic/math/hypot.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_hypot.h>
 
 #define FUNCTION hypot
diff --git a/libclc/generic/lib/math/ilogb.cl b/libclc/opencl/lib/generic/math/ilogb.cl
similarity index 94%
rename from libclc/generic/lib/math/ilogb.cl
rename to libclc/opencl/lib/generic/math/ilogb.cl
index 9e3795a524b23..bb38061ab31d6 100644
--- a/libclc/generic/lib/math/ilogb.cl
+++ b/libclc/opencl/lib/generic/math/ilogb.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_ilogb.h>
 
 #define FUNCTION ilogb
diff --git a/libclc/generic/lib/math/ldexp.cl b/libclc/opencl/lib/generic/math/ldexp.cl
similarity index 97%
rename from libclc/generic/lib/math/ldexp.cl
rename to libclc/opencl/lib/generic/math/ldexp.cl
index 4dbb58fe3d5bc..5911ec9d9a8c9 100644
--- a/libclc/generic/lib/math/ldexp.cl
+++ b/libclc/opencl/lib/generic/math/ldexp.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_ldexp.h>
 
diff --git a/libclc/generic/lib/math/ldexp.inc b/libclc/opencl/lib/generic/math/ldexp.inc
similarity index 100%
rename from libclc/generic/lib/math/ldexp.inc
rename to libclc/opencl/lib/generic/math/ldexp.inc
diff --git a/libclc/generic/lib/math/lgamma.cl b/libclc/opencl/lib/generic/math/lgamma.cl
similarity index 94%
rename from libclc/generic/lib/math/lgamma.cl
rename to libclc/opencl/lib/generic/math/lgamma.cl
index e9cc76e2220e4..0c95094d3fc9e 100644
--- a/libclc/generic/lib/math/lgamma.cl
+++ b/libclc/opencl/lib/generic/math/lgamma.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_lgamma.h>
 
 #define FUNCTION lgamma
diff --git a/libclc/generic/lib/math/lgamma_r.cl b/libclc/opencl/lib/generic/math/lgamma_r.cl
similarity index 94%
rename from libclc/generic/lib/math/lgamma_r.cl
rename to libclc/opencl/lib/generic/math/lgamma_r.cl
index 66fdb741ca659..f20583b56a2d5 100644
--- a/libclc/generic/lib/math/lgamma_r.cl
+++ b/libclc/opencl/lib/generic/math/lgamma_r.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_lgamma_r.h>
 
 #define FUNCTION lgamma_r
diff --git a/libclc/generic/lib/math/log.cl b/libclc/opencl/lib/generic/math/log.cl
similarity index 94%
rename from libclc/generic/lib/math/log.cl
rename to libclc/opencl/lib/generic/math/log.cl
index 43d3fdc8d20cc..b41254c36e313 100644
--- a/libclc/generic/lib/math/log.cl
+++ b/libclc/opencl/lib/generic/math/log.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_log.h>
 
diff --git a/libclc/generic/lib/math/log10.cl b/libclc/opencl/lib/generic/math/log10.cl
similarity index 94%
rename from libclc/generic/lib/math/log10.cl
rename to libclc/opencl/lib/generic/math/log10.cl
index db405d4929d24..41e43ea1a105a 100644
--- a/libclc/generic/lib/math/log10.cl
+++ b/libclc/opencl/lib/generic/math/log10.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_log10.h>
 
diff --git a/libclc/generic/lib/math/log1p.cl b/libclc/opencl/lib/generic/math/log1p.cl
similarity index 94%
rename from libclc/generic/lib/math/log1p.cl
rename to libclc/opencl/lib/generic/math/log1p.cl
index 47245d1178a58..40bc5d9e61c27 100644
--- a/libclc/generic/lib/math/log1p.cl
+++ b/libclc/opencl/lib/generic/math/log1p.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_log1p.h>
 
 #define FUNCTION log1p
diff --git a/libclc/generic/lib/math/log2.cl b/libclc/opencl/lib/generic/math/log2.cl
similarity index 94%
rename from libclc/generic/lib/math/log2.cl
rename to libclc/opencl/lib/generic/math/log2.cl
index 6e54f433f3591..861dfc18979d4 100644
--- a/libclc/generic/lib/math/log2.cl
+++ b/libclc/opencl/lib/generic/math/log2.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_log2.h>
 
diff --git a/libclc/generic/lib/math/logb.cl b/libclc/opencl/lib/generic/math/logb.cl
similarity index 94%
rename from libclc/generic/lib/math/logb.cl
rename to libclc/opencl/lib/generic/math/logb.cl
index 25e676ef98fbd..c3b9170e67302 100644
--- a/libclc/generic/lib/math/logb.cl
+++ b/libclc/opencl/lib/generic/math/logb.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_logb.h>
 
 #define FUNCTION logb
diff --git a/libclc/generic/lib/math/mad.cl b/libclc/opencl/lib/generic/math/mad.cl
similarity index 96%
rename from libclc/generic/lib/math/mad.cl
rename to libclc/opencl/lib/generic/math/mad.cl
index 611dca19f1d8c..cee2a35c239e4 100644
--- a/libclc/generic/lib/math/mad.cl
+++ b/libclc/opencl/lib/generic/math/mad.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_mad.h>
 
diff --git a/libclc/generic/lib/math/maxmag.cl b/libclc/opencl/lib/generic/math/maxmag.cl
similarity index 94%
rename from libclc/generic/lib/math/maxmag.cl
rename to libclc/opencl/lib/generic/math/maxmag.cl
index 720fc027177ac..ea31a8554dec8 100644
--- a/libclc/generic/lib/math/maxmag.cl
+++ b/libclc/opencl/lib/generic/math/maxmag.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_maxmag.h>
 
 #define FUNCTION maxmag
diff --git a/libclc/generic/lib/math/minmag.cl b/libclc/opencl/lib/generic/math/minmag.cl
similarity index 94%
rename from libclc/generic/lib/math/minmag.cl
rename to libclc/opencl/lib/generic/math/minmag.cl
index 37536584f8f85..6c7b61c56f853 100644
--- a/libclc/generic/lib/math/minmag.cl
+++ b/libclc/opencl/lib/generic/math/minmag.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_minmag.h>
 
 #define FUNCTION minmag
diff --git a/libclc/generic/lib/math/modf.cl b/libclc/opencl/lib/generic/math/modf.cl
similarity index 94%
rename from libclc/generic/lib/math/modf.cl
rename to libclc/opencl/lib/generic/math/modf.cl
index cf4eaa8012b52..c7a4045694aad 100644
--- a/libclc/generic/lib/math/modf.cl
+++ b/libclc/opencl/lib/generic/math/modf.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_modf.h>
 
 #define FUNCTION modf
diff --git a/libclc/generic/lib/math/nan.cl b/libclc/opencl/lib/generic/math/nan.cl
similarity index 100%
rename from libclc/generic/lib/math/nan.cl
rename to libclc/opencl/lib/generic/math/nan.cl
diff --git a/libclc/generic/lib/math/nan.inc b/libclc/opencl/lib/generic/math/nan.inc
similarity index 100%
rename from libclc/generic/lib/math/nan.inc
rename to libclc/opencl/lib/generic/math/nan.inc
diff --git a/libclc/generic/lib/math/native_cos.cl b/libclc/opencl/lib/generic/math/native_cos.cl
similarity index 95%
rename from libclc/generic/lib/math/native_cos.cl
rename to libclc/opencl/lib/generic/math/native_cos.cl
index 0f4d46c1d73e4..933ebd2519b7c 100644
--- a/libclc/generic/lib/math/native_cos.cl
+++ b/libclc/opencl/lib/generic/math/native_cos.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_cos.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/native_divide.cl b/libclc/opencl/lib/generic/math/native_divide.cl
similarity index 95%
rename from libclc/generic/lib/math/native_divide.cl
rename to libclc/opencl/lib/generic/math/native_divide.cl
index a4d9b830b5519..ac4ad17cc0301 100644
--- a/libclc/generic/lib/math/native_divide.cl
+++ b/libclc/opencl/lib/generic/math/native_divide.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_divide.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/native_exp.cl b/libclc/opencl/lib/generic/math/native_exp.cl
similarity index 95%
rename from libclc/generic/lib/math/native_exp.cl
rename to libclc/opencl/lib/generic/math/native_exp.cl
index c1d08ec2c7e1f..ddab9223dba9a 100644
--- a/libclc/generic/lib/math/native_exp.cl
+++ b/libclc/opencl/lib/generic/math/native_exp.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_exp.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/native_exp10.cl b/libclc/opencl/lib/generic/math/native_exp10.cl
similarity index 95%
rename from libclc/generic/lib/math/native_exp10.cl
rename to libclc/opencl/lib/generic/math/native_exp10.cl
index a7f3711cbedfd..082591285c4c0 100644
--- a/libclc/generic/lib/math/native_exp10.cl
+++ b/libclc/opencl/lib/generic/math/native_exp10.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_exp10.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/native_exp2.cl b/libclc/opencl/lib/generic/math/native_exp2.cl
similarity index 95%
rename from libclc/generic/lib/math/native_exp2.cl
rename to libclc/opencl/lib/generic/math/native_exp2.cl
index ceb570733b974..a4ca5f5ec5cbd 100644
--- a/libclc/generic/lib/math/native_exp2.cl
+++ b/libclc/opencl/lib/generic/math/native_exp2.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_exp2.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/native_log.cl b/libclc/opencl/lib/generic/math/native_log.cl
similarity index 95%
rename from libclc/generic/lib/math/native_log.cl
rename to libclc/opencl/lib/generic/math/native_log.cl
index adc2ff495f8b5..cc9018edacb8f 100644
--- a/libclc/generic/lib/math/native_log.cl
+++ b/libclc/opencl/lib/generic/math/native_log.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_log.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/native_log10.cl b/libclc/opencl/lib/generic/math/native_log10.cl
similarity index 95%
rename from libclc/generic/lib/math/native_log10.cl
rename to libclc/opencl/lib/generic/math/native_log10.cl
index f63292124f3b7..75a019186725b 100644
--- a/libclc/generic/lib/math/native_log10.cl
+++ b/libclc/opencl/lib/generic/math/native_log10.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_log10.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/native_log2.cl b/libclc/opencl/lib/generic/math/native_log2.cl
similarity index 95%
rename from libclc/generic/lib/math/native_log2.cl
rename to libclc/opencl/lib/generic/math/native_log2.cl
index 6b079872b1e0a..f54ea311ede76 100644
--- a/libclc/generic/lib/math/native_log2.cl
+++ b/libclc/opencl/lib/generic/math/native_log2.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_log2.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/native_powr.cl b/libclc/opencl/lib/generic/math/native_powr.cl
similarity index 95%
rename from libclc/generic/lib/math/native_powr.cl
rename to libclc/opencl/lib/generic/math/native_powr.cl
index 31a650b79b609..0d7a022028bb6 100644
--- a/libclc/generic/lib/math/native_powr.cl
+++ b/libclc/opencl/lib/generic/math/native_powr.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_powr.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/native_recip.cl b/libclc/opencl/lib/generic/math/native_recip.cl
similarity index 95%
rename from libclc/generic/lib/math/native_recip.cl
rename to libclc/opencl/lib/generic/math/native_recip.cl
index 3c844495046f1..b93cfaa88b9a6 100644
--- a/libclc/generic/lib/math/native_recip.cl
+++ b/libclc/opencl/lib/generic/math/native_recip.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_recip.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/native_rsqrt.cl b/libclc/opencl/lib/generic/math/native_rsqrt.cl
similarity index 95%
rename from libclc/generic/lib/math/native_rsqrt.cl
rename to libclc/opencl/lib/generic/math/native_rsqrt.cl
index cb49b2d1d6706..d5506b335cda1 100644
--- a/libclc/generic/lib/math/native_rsqrt.cl
+++ b/libclc/opencl/lib/generic/math/native_rsqrt.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_rsqrt.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/native_sin.cl b/libclc/opencl/lib/generic/math/native_sin.cl
similarity index 95%
rename from libclc/generic/lib/math/native_sin.cl
rename to libclc/opencl/lib/generic/math/native_sin.cl
index 50265b3936272..e201b8e7db868 100644
--- a/libclc/generic/lib/math/native_sin.cl
+++ b/libclc/opencl/lib/generic/math/native_sin.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_sin.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/native_sqrt.cl b/libclc/opencl/lib/generic/math/native_sqrt.cl
similarity index 95%
rename from libclc/generic/lib/math/native_sqrt.cl
rename to libclc/opencl/lib/generic/math/native_sqrt.cl
index 4cd022e8bbeba..eb0311caa3451 100644
--- a/libclc/generic/lib/math/native_sqrt.cl
+++ b/libclc/opencl/lib/generic/math/native_sqrt.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_sqrt.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/native_tan.cl b/libclc/opencl/lib/generic/math/native_tan.cl
similarity index 95%
rename from libclc/generic/lib/math/native_tan.cl
rename to libclc/opencl/lib/generic/math/native_tan.cl
index 2b474ed46a5b5..337e8537f22e7 100644
--- a/libclc/generic/lib/math/native_tan.cl
+++ b/libclc/opencl/lib/generic/math/native_tan.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_tan.h>
 
 #define __FLOAT_ONLY
diff --git a/libclc/generic/lib/math/nextafter.cl b/libclc/opencl/lib/generic/math/nextafter.cl
similarity index 97%
rename from libclc/generic/lib/math/nextafter.cl
rename to libclc/opencl/lib/generic/math/nextafter.cl
index 3dbe224924780..3482f4f877c67 100644
--- a/libclc/generic/lib/math/nextafter.cl
+++ b/libclc/opencl/lib/generic/math/nextafter.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_nextafter.h>
 
diff --git a/libclc/generic/lib/math/pow.cl b/libclc/opencl/lib/generic/math/pow.cl
similarity index 94%
rename from libclc/generic/lib/math/pow.cl
rename to libclc/opencl/lib/generic/math/pow.cl
index a997d32e16f5e..3730254513fa1 100644
--- a/libclc/generic/lib/math/pow.cl
+++ b/libclc/opencl/lib/generic/math/pow.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_pow.h>
 
 #define FUNCTION pow
diff --git a/libclc/generic/lib/math/pown.cl b/libclc/opencl/lib/generic/math/pown.cl
similarity index 94%
rename from libclc/generic/lib/math/pown.cl
rename to libclc/opencl/lib/generic/math/pown.cl
index 8c077f7aae148..38b1e9031874f 100644
--- a/libclc/generic/lib/math/pown.cl
+++ b/libclc/opencl/lib/generic/math/pown.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_pown.h>
 
 #define FUNCTION pown
diff --git a/libclc/generic/lib/math/powr.cl b/libclc/opencl/lib/generic/math/powr.cl
similarity index 94%
rename from libclc/generic/lib/math/powr.cl
rename to libclc/opencl/lib/generic/math/powr.cl
index 8b3df54a2434a..1878f1ed8aaaa 100644
--- a/libclc/generic/lib/math/powr.cl
+++ b/libclc/opencl/lib/generic/math/powr.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_powr.h>
 
 #define FUNCTION powr
diff --git a/libclc/generic/lib/math/remainder.cl b/libclc/opencl/lib/generic/math/remainder.cl
similarity index 94%
rename from libclc/generic/lib/math/remainder.cl
rename to libclc/opencl/lib/generic/math/remainder.cl
index b5f96c2cd6036..8ec049b102e4a 100644
--- a/libclc/generic/lib/math/remainder.cl
+++ b/libclc/opencl/lib/generic/math/remainder.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_remainder.h>
 
 #define FUNCTION remainder
diff --git a/libclc/generic/lib/math/remquo.cl b/libclc/opencl/lib/generic/math/remquo.cl
similarity index 96%
rename from libclc/generic/lib/math/remquo.cl
rename to libclc/opencl/lib/generic/math/remquo.cl
index d0c4b16ed7c39..097c9cdb75386 100644
--- a/libclc/generic/lib/math/remquo.cl
+++ b/libclc/opencl/lib/generic/math/remquo.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_remquo.h>
 
 #define __CLC_BODY <remquo.inc>
diff --git a/libclc/generic/lib/math/remquo.inc b/libclc/opencl/lib/generic/math/remquo.inc
similarity index 100%
rename from libclc/generic/lib/math/remquo.inc
rename to libclc/opencl/lib/generic/math/remquo.inc
diff --git a/libclc/generic/lib/math/rint.cl b/libclc/opencl/lib/generic/math/rint.cl
similarity index 94%
rename from libclc/generic/lib/math/rint.cl
rename to libclc/opencl/lib/generic/math/rint.cl
index b84438067a9c7..ff593bc3ba35b 100644
--- a/libclc/generic/lib/math/rint.cl
+++ b/libclc/opencl/lib/generic/math/rint.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_rint.h>
 
 #define FUNCTION rint
diff --git a/libclc/generic/lib/math/rootn.cl b/libclc/opencl/lib/generic/math/rootn.cl
similarity index 94%
rename from libclc/generic/lib/math/rootn.cl
rename to libclc/opencl/lib/generic/math/rootn.cl
index b14248636e149..a075699322260 100644
--- a/libclc/generic/lib/math/rootn.cl
+++ b/libclc/opencl/lib/generic/math/rootn.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_rootn.h>
 
 #define FUNCTION rootn
diff --git a/libclc/generic/lib/math/round.cl b/libclc/opencl/lib/generic/math/round.cl
similarity index 94%
rename from libclc/generic/lib/math/round.cl
rename to libclc/opencl/lib/generic/math/round.cl
index bf1ced1e8abc9..0f0257bb4faf6 100644
--- a/libclc/generic/lib/math/round.cl
+++ b/libclc/opencl/lib/generic/math/round.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_round.h>
 
 #define FUNCTION round
diff --git a/libclc/generic/lib/math/rsqrt.cl b/libclc/opencl/lib/generic/math/rsqrt.cl
similarity index 94%
rename from libclc/generic/lib/math/rsqrt.cl
rename to libclc/opencl/lib/generic/math/rsqrt.cl
index b2ba9ad6fc0b9..72c8b5fc55d72 100644
--- a/libclc/generic/lib/math/rsqrt.cl
+++ b/libclc/opencl/lib/generic/math/rsqrt.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_rsqrt.h>
 
 #define FUNCTION rsqrt
diff --git a/libclc/generic/lib/math/sin.cl b/libclc/opencl/lib/generic/math/sin.cl
similarity index 94%
rename from libclc/generic/lib/math/sin.cl
rename to libclc/opencl/lib/generic/math/sin.cl
index 76728cfb1c5e5..864adfb1d044c 100644
--- a/libclc/generic/lib/math/sin.cl
+++ b/libclc/opencl/lib/generic/math/sin.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_sin.h>
 
 #define FUNCTION sin
diff --git a/libclc/generic/lib/math/sincos.cl b/libclc/opencl/lib/generic/math/sincos.cl
similarity index 94%
rename from libclc/generic/lib/math/sincos.cl
rename to libclc/opencl/lib/generic/math/sincos.cl
index 25e620cf2a38e..a2baf13ce6cba 100644
--- a/libclc/generic/lib/math/sincos.cl
+++ b/libclc/opencl/lib/generic/math/sincos.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_sincos.h>
 
 #define FUNCTION sincos
diff --git a/libclc/generic/lib/math/sinh.cl b/libclc/opencl/lib/generic/math/sinh.cl
similarity index 94%
rename from libclc/generic/lib/math/sinh.cl
rename to libclc/opencl/lib/generic/math/sinh.cl
index 305f9bf647ff7..70cfb4f53ae8d 100644
--- a/libclc/generic/lib/math/sinh.cl
+++ b/libclc/opencl/lib/generic/math/sinh.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_sinh.h>
 
 #define FUNCTION sinh
diff --git a/libclc/generic/lib/math/sinpi.cl b/libclc/opencl/lib/generic/math/sinpi.cl
similarity index 94%
rename from libclc/generic/lib/math/sinpi.cl
rename to libclc/opencl/lib/generic/math/sinpi.cl
index 223e7db142117..f09307b489170 100644
--- a/libclc/generic/lib/math/sinpi.cl
+++ b/libclc/opencl/lib/generic/math/sinpi.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_sinpi.h>
 
 #define FUNCTION sinpi
diff --git a/libclc/generic/lib/math/sqrt.cl b/libclc/opencl/lib/generic/math/sqrt.cl
similarity index 94%
rename from libclc/generic/lib/math/sqrt.cl
rename to libclc/opencl/lib/generic/math/sqrt.cl
index 7e46186025481..f553d54a7ef27 100644
--- a/libclc/generic/lib/math/sqrt.cl
+++ b/libclc/opencl/lib/generic/math/sqrt.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_sqrt.h>
 
 #define FUNCTION sqrt
diff --git a/libclc/generic/lib/math/tan.cl b/libclc/opencl/lib/generic/math/tan.cl
similarity index 94%
rename from libclc/generic/lib/math/tan.cl
rename to libclc/opencl/lib/generic/math/tan.cl
index 883e331395616..af5b5659f8ca8 100644
--- a/libclc/generic/lib/math/tan.cl
+++ b/libclc/opencl/lib/generic/math/tan.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_tan.h>
 
 #define FUNCTION tan
diff --git a/libclc/generic/lib/math/tanh.cl b/libclc/opencl/lib/generic/math/tanh.cl
similarity index 94%
rename from libclc/generic/lib/math/tanh.cl
rename to libclc/opencl/lib/generic/math/tanh.cl
index f576910f16deb..2796f331a88db 100644
--- a/libclc/generic/lib/math/tanh.cl
+++ b/libclc/opencl/lib/generic/math/tanh.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_tanh.h>
 
 #define FUNCTION tanh
diff --git a/libclc/generic/lib/math/tanpi.cl b/libclc/opencl/lib/generic/math/tanpi.cl
similarity index 94%
rename from libclc/generic/lib/math/tanpi.cl
rename to libclc/opencl/lib/generic/math/tanpi.cl
index 8015d32adb38d..ab991cc90d312 100644
--- a/libclc/generic/lib/math/tanpi.cl
+++ b/libclc/opencl/lib/generic/math/tanpi.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_tanpi.h>
 
 #define FUNCTION tanpi
diff --git a/libclc/generic/lib/math/tgamma.cl b/libclc/opencl/lib/generic/math/tgamma.cl
similarity index 94%
rename from libclc/generic/lib/math/tgamma.cl
rename to libclc/opencl/lib/generic/math/tgamma.cl
index e400883d55d75..8904b95236278 100644
--- a/libclc/generic/lib/math/tgamma.cl
+++ b/libclc/opencl/lib/generic/math/tgamma.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_tgamma.h>
 
 #define FUNCTION tgamma
diff --git a/libclc/generic/lib/math/trunc.cl b/libclc/opencl/lib/generic/math/trunc.cl
similarity index 94%
rename from libclc/generic/lib/math/trunc.cl
rename to libclc/opencl/lib/generic/math/trunc.cl
index d668f39f23341..2f929a4a76c28 100644
--- a/libclc/generic/lib/math/trunc.cl
+++ b/libclc/opencl/lib/generic/math/trunc.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_trunc.h>
 
 #define FUNCTION trunc
diff --git a/libclc/generic/lib/misc/shuffle.cl b/libclc/opencl/lib/generic/misc/shuffle.cl
similarity index 95%
rename from libclc/generic/lib/misc/shuffle.cl
rename to libclc/opencl/lib/generic/misc/shuffle.cl
index 44bcb36bde0e2..ea4bca42e84c3 100644
--- a/libclc/generic/lib/misc/shuffle.cl
+++ b/libclc/opencl/lib/generic/misc/shuffle.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/misc/clc_shuffle.h>
 
 #define FUNCTION shuffle
diff --git a/libclc/generic/lib/misc/shuffle2.cl b/libclc/opencl/lib/generic/misc/shuffle2.cl
similarity index 95%
rename from libclc/generic/lib/misc/shuffle2.cl
rename to libclc/opencl/lib/generic/misc/shuffle2.cl
index 718f5580b7323..5894fe3bb8ce9 100644
--- a/libclc/generic/lib/misc/shuffle2.cl
+++ b/libclc/opencl/lib/generic/misc/shuffle2.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/misc/clc_shuffle2.h>
 
 #define FUNCTION shuffle2
diff --git a/libclc/generic/lib/relational/all.cl b/libclc/opencl/lib/generic/relational/all.cl
similarity index 97%
rename from libclc/generic/lib/relational/all.cl
rename to libclc/opencl/lib/generic/relational/all.cl
index f5fd9af54966e..43a3236bafe65 100644
--- a/libclc/generic/lib/relational/all.cl
+++ b/libclc/opencl/lib/generic/relational/all.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_all.h>
 
 #define ALL_ID(TYPE) _CLC_OVERLOAD _CLC_DEF int all(TYPE v)
diff --git a/libclc/generic/lib/relational/any.cl b/libclc/opencl/lib/generic/relational/any.cl
similarity index 97%
rename from libclc/generic/lib/relational/any.cl
rename to libclc/opencl/lib/generic/relational/any.cl
index c661b90cebc51..ae78c623f53f1 100644
--- a/libclc/generic/lib/relational/any.cl
+++ b/libclc/opencl/lib/generic/relational/any.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_any.h>
 
 #define ANY_ID(TYPE) _CLC_OVERLOAD _CLC_DEF int any(TYPE v)
diff --git a/libclc/generic/lib/relational/binary_def.inc b/libclc/opencl/lib/generic/relational/binary_def.inc
similarity index 100%
rename from libclc/generic/lib/relational/binary_def.inc
rename to libclc/opencl/lib/generic/relational/binary_def.inc
diff --git a/libclc/generic/lib/relational/bitselect.cl b/libclc/opencl/lib/generic/relational/bitselect.cl
similarity index 95%
rename from libclc/generic/lib/relational/bitselect.cl
rename to libclc/opencl/lib/generic/relational/bitselect.cl
index 2dd1191cfd655..fc0a15768c5f5 100644
--- a/libclc/generic/lib/relational/bitselect.cl
+++ b/libclc/opencl/lib/generic/relational/bitselect.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_bitselect.h>
 
 #define __CLC_BODY <bitselect.inc>
diff --git a/libclc/generic/lib/relational/bitselect.inc b/libclc/opencl/lib/generic/relational/bitselect.inc
similarity index 100%
rename from libclc/generic/lib/relational/bitselect.inc
rename to libclc/opencl/lib/generic/relational/bitselect.inc
diff --git a/libclc/generic/lib/relational/isequal.cl b/libclc/opencl/lib/generic/relational/isequal.cl
similarity index 94%
rename from libclc/generic/lib/relational/isequal.cl
rename to libclc/opencl/lib/generic/relational/isequal.cl
index 31f06adee00da..71109d0e0bf3e 100644
--- a/libclc/generic/lib/relational/isequal.cl
+++ b/libclc/opencl/lib/generic/relational/isequal.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isequal.h>
 
 #define FUNCTION isequal
diff --git a/libclc/generic/lib/relational/isfinite.cl b/libclc/opencl/lib/generic/relational/isfinite.cl
similarity index 94%
rename from libclc/generic/lib/relational/isfinite.cl
rename to libclc/opencl/lib/generic/relational/isfinite.cl
index 180bf9990173d..7ee3ff2262f54 100644
--- a/libclc/generic/lib/relational/isfinite.cl
+++ b/libclc/opencl/lib/generic/relational/isfinite.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isfinite.h>
 
 #define FUNCTION isfinite
diff --git a/libclc/generic/lib/relational/isgreater.cl b/libclc/opencl/lib/generic/relational/isgreater.cl
similarity index 94%
rename from libclc/generic/lib/relational/isgreater.cl
rename to libclc/opencl/lib/generic/relational/isgreater.cl
index 012ad7a5cdb3f..13ecfa70fa4f6 100644
--- a/libclc/generic/lib/relational/isgreater.cl
+++ b/libclc/opencl/lib/generic/relational/isgreater.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isgreater.h>
 
 #define FUNCTION isgreater
diff --git a/libclc/generic/lib/relational/isgreaterequal.cl b/libclc/opencl/lib/generic/relational/isgreaterequal.cl
similarity index 94%
rename from libclc/generic/lib/relational/isgreaterequal.cl
rename to libclc/opencl/lib/generic/relational/isgreaterequal.cl
index 24fca170a1671..458c4a6f6b747 100644
--- a/libclc/generic/lib/relational/isgreaterequal.cl
+++ b/libclc/opencl/lib/generic/relational/isgreaterequal.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isgreaterequal.h>
 
 #define FUNCTION isgreaterequal
diff --git a/libclc/generic/lib/relational/isinf.cl b/libclc/opencl/lib/generic/relational/isinf.cl
similarity index 94%
rename from libclc/generic/lib/relational/isinf.cl
rename to libclc/opencl/lib/generic/relational/isinf.cl
index e295d14215478..65e987940ff50 100644
--- a/libclc/generic/lib/relational/isinf.cl
+++ b/libclc/opencl/lib/generic/relational/isinf.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isinf.h>
 
 #define FUNCTION isinf
diff --git a/libclc/generic/lib/relational/isless.cl b/libclc/opencl/lib/generic/relational/isless.cl
similarity index 94%
rename from libclc/generic/lib/relational/isless.cl
rename to libclc/opencl/lib/generic/relational/isless.cl
index 3b295c11e1c4a..e1b931aede695 100644
--- a/libclc/generic/lib/relational/isless.cl
+++ b/libclc/opencl/lib/generic/relational/isless.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isless.h>
 
 #define FUNCTION isless
diff --git a/libclc/generic/lib/relational/islessequal.cl b/libclc/opencl/lib/generic/relational/islessequal.cl
similarity index 94%
rename from libclc/generic/lib/relational/islessequal.cl
rename to libclc/opencl/lib/generic/relational/islessequal.cl
index 270165fe5e173..91d0891e21223 100644
--- a/libclc/generic/lib/relational/islessequal.cl
+++ b/libclc/opencl/lib/generic/relational/islessequal.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_islessequal.h>
 
 #define FUNCTION islessequal
diff --git a/libclc/generic/lib/relational/islessgreater.cl b/libclc/opencl/lib/generic/relational/islessgreater.cl
similarity index 94%
rename from libclc/generic/lib/relational/islessgreater.cl
rename to libclc/opencl/lib/generic/relational/islessgreater.cl
index 2755aa5a74603..dc519cc602752 100644
--- a/libclc/generic/lib/relational/islessgreater.cl
+++ b/libclc/opencl/lib/generic/relational/islessgreater.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_islessgreater.h>
 
 #define FUNCTION islessgreater
diff --git a/libclc/generic/lib/relational/isnan.cl b/libclc/opencl/lib/generic/relational/isnan.cl
similarity index 94%
rename from libclc/generic/lib/relational/isnan.cl
rename to libclc/opencl/lib/generic/relational/isnan.cl
index 1a78c909bec77..6761851caffe4 100644
--- a/libclc/generic/lib/relational/isnan.cl
+++ b/libclc/opencl/lib/generic/relational/isnan.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isnan.h>
 
 #define FUNCTION isnan
diff --git a/libclc/generic/lib/relational/isnormal.cl b/libclc/opencl/lib/generic/relational/isnormal.cl
similarity index 94%
rename from libclc/generic/lib/relational/isnormal.cl
rename to libclc/opencl/lib/generic/relational/isnormal.cl
index 84a031b6bc562..42f3e1f4f4349 100644
--- a/libclc/generic/lib/relational/isnormal.cl
+++ b/libclc/opencl/lib/generic/relational/isnormal.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isnormal.h>
 
 #define FUNCTION isnormal
diff --git a/libclc/generic/lib/relational/isnotequal.cl b/libclc/opencl/lib/generic/relational/isnotequal.cl
similarity index 94%
rename from libclc/generic/lib/relational/isnotequal.cl
rename to libclc/opencl/lib/generic/relational/isnotequal.cl
index e5c168aca832f..f28317b8fe0f5 100644
--- a/libclc/generic/lib/relational/isnotequal.cl
+++ b/libclc/opencl/lib/generic/relational/isnotequal.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isnotequal.h>
 
 #define FUNCTION isnotequal
diff --git a/libclc/generic/lib/relational/isordered.cl b/libclc/opencl/lib/generic/relational/isordered.cl
similarity index 94%
rename from libclc/generic/lib/relational/isordered.cl
rename to libclc/opencl/lib/generic/relational/isordered.cl
index 563cf3d4780aa..83117765d5261 100644
--- a/libclc/generic/lib/relational/isordered.cl
+++ b/libclc/opencl/lib/generic/relational/isordered.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isordered.h>
 
 #define FUNCTION isordered
diff --git a/libclc/generic/lib/relational/isunordered.cl b/libclc/opencl/lib/generic/relational/isunordered.cl
similarity index 94%
rename from libclc/generic/lib/relational/isunordered.cl
rename to libclc/opencl/lib/generic/relational/isunordered.cl
index fb707bb74e5ff..26deb195a7406 100644
--- a/libclc/generic/lib/relational/isunordered.cl
+++ b/libclc/opencl/lib/generic/relational/isunordered.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isunordered.h>
 
 #define FUNCTION isunordered
diff --git a/libclc/generic/lib/relational/select.cl b/libclc/opencl/lib/generic/relational/select.cl
similarity index 96%
rename from libclc/generic/lib/relational/select.cl
rename to libclc/opencl/lib/generic/relational/select.cl
index a39aaf4bce40d..c29109b1d3c2c 100644
--- a/libclc/generic/lib/relational/select.cl
+++ b/libclc/opencl/lib/generic/relational/select.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_select.h>
 #include <clc/utils.h>
 
diff --git a/libclc/generic/lib/relational/signbit.cl b/libclc/opencl/lib/generic/relational/signbit.cl
similarity index 94%
rename from libclc/generic/lib/relational/signbit.cl
rename to libclc/opencl/lib/generic/relational/signbit.cl
index 4828c2596bad6..2b58922bf8705 100644
--- a/libclc/generic/lib/relational/signbit.cl
+++ b/libclc/opencl/lib/generic/relational/signbit.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_signbit.h>
 
 #define FUNCTION signbit
diff --git a/libclc/generic/lib/relational/unary_def.inc b/libclc/opencl/lib/generic/relational/unary_def.inc
similarity index 100%
rename from libclc/generic/lib/relational/unary_def.inc
rename to libclc/opencl/lib/generic/relational/unary_def.inc
diff --git a/libclc/generic/lib/shared/clamp.cl b/libclc/opencl/lib/generic/shared/clamp.cl
similarity index 95%
rename from libclc/generic/lib/shared/clamp.cl
rename to libclc/opencl/lib/generic/shared/clamp.cl
index caaa0acb06568..4d00f6f8c3a68 100644
--- a/libclc/generic/lib/shared/clamp.cl
+++ b/libclc/opencl/lib/generic/shared/clamp.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/shared/clc_clamp.h>
 
 #define __CLC_BODY <clamp.inc>
diff --git a/libclc/generic/lib/shared/clamp.inc b/libclc/opencl/lib/generic/shared/clamp.inc
similarity index 100%
rename from libclc/generic/lib/shared/clamp.inc
rename to libclc/opencl/lib/generic/shared/clamp.inc
diff --git a/libclc/generic/lib/shared/max.cl b/libclc/opencl/lib/generic/shared/max.cl
similarity index 94%
rename from libclc/generic/lib/shared/max.cl
rename to libclc/opencl/lib/generic/shared/max.cl
index 9ea532eca6b05..59f0b7e3b4c8e 100644
--- a/libclc/generic/lib/shared/max.cl
+++ b/libclc/opencl/lib/generic/shared/max.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/shared/clc_max.h>
 
 #define __CLC_BODY <max.inc>
diff --git a/libclc/generic/lib/shared/max.inc b/libclc/opencl/lib/generic/shared/max.inc
similarity index 100%
rename from libclc/generic/lib/shared/max.inc
rename to libclc/opencl/lib/generic/shared/max.inc
diff --git a/libclc/generic/lib/shared/min.cl b/libclc/opencl/lib/generic/shared/min.cl
similarity index 94%
rename from libclc/generic/lib/shared/min.cl
rename to libclc/opencl/lib/generic/shared/min.cl
index f7d043f224f8c..6c491c5eb1cbf 100644
--- a/libclc/generic/lib/shared/min.cl
+++ b/libclc/opencl/lib/generic/shared/min.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/shared/clc_min.h>
 
 #define __CLC_BODY <min.inc>
diff --git a/libclc/generic/lib/shared/min.inc b/libclc/opencl/lib/generic/shared/min.inc
similarity index 100%
rename from libclc/generic/lib/shared/min.inc
rename to libclc/opencl/lib/generic/shared/min.inc
diff --git a/libclc/generic/lib/shared/vload.cl b/libclc/opencl/lib/generic/shared/vload.cl
similarity index 99%
rename from libclc/generic/lib/shared/vload.cl
rename to libclc/opencl/lib/generic/shared/vload.cl
index dd3a0ada456ee..41f3629443e75 100644
--- a/libclc/generic/lib/shared/vload.cl
+++ b/libclc/opencl/lib/generic/shared/vload.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #define VLOAD_VECTORIZE(PRIM_TYPE, ADDR_SPACE)                                 \
   typedef PRIM_TYPE##2 less_aligned_##ADDR_SPACE##PRIM_TYPE##2                 \
diff --git a/libclc/generic/lib/shared/vload_half.inc b/libclc/opencl/lib/generic/shared/vload_half.inc
similarity index 100%
rename from libclc/generic/lib/shared/vload_half.inc
rename to libclc/opencl/lib/generic/shared/vload_half.inc
diff --git a/libclc/generic/lib/shared/vstore.cl b/libclc/opencl/lib/generic/shared/vstore.cl
similarity index 99%
rename from libclc/generic/lib/shared/vstore.cl
rename to libclc/opencl/lib/generic/shared/vstore.cl
index 5d039d07f5e29..78d5865aa1d17 100644
--- a/libclc/generic/lib/shared/vstore.cl
+++ b/libclc/opencl/lib/generic/shared/vstore.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #pragma OPENCL EXTENSION cl_khr_byte_addressable_store : enable
 
diff --git a/libclc/generic/lib/shared/vstore_half.inc b/libclc/opencl/lib/generic/shared/vstore_half.inc
similarity index 100%
rename from libclc/generic/lib/shared/vstore_half.inc
rename to libclc/opencl/lib/generic/shared/vstore_half.inc
diff --git a/libclc/generic/lib/subnormal_config.cl b/libclc/opencl/lib/generic/subnormal_config.cl
similarity index 95%
rename from libclc/generic/lib/subnormal_config.cl
rename to libclc/opencl/lib/generic/subnormal_config.cl
index a77886800ba65..326484b979b51 100644
--- a/libclc/generic/lib/subnormal_config.cl
+++ b/libclc/opencl/lib/generic/subnormal_config.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_subnormal_config.h>
 
 _CLC_DEF bool __clc_fp16_subnormals_supported() {
diff --git a/libclc/generic/lib/subnormal_disable.ll b/libclc/opencl/lib/generic/subnormal_disable.ll
similarity index 100%
rename from libclc/generic/lib/subnormal_disable.ll
rename to libclc/opencl/lib/generic/subnormal_disable.ll
diff --git a/libclc/generic/lib/subnormal_helper_func.ll b/libclc/opencl/lib/generic/subnormal_helper_func.ll
similarity index 100%
rename from libclc/generic/lib/subnormal_helper_func.ll
rename to libclc/opencl/lib/generic/subnormal_helper_func.ll
diff --git a/libclc/generic/lib/subnormal_use_default.ll b/libclc/opencl/lib/generic/subnormal_use_default.ll
similarity index 100%
rename from libclc/generic/lib/subnormal_use_default.ll
rename to libclc/opencl/lib/generic/subnormal_use_default.ll
diff --git a/libclc/generic/lib/workitem/get_global_id.cl b/libclc/opencl/lib/generic/workitem/get_global_id.cl
similarity index 94%
rename from libclc/generic/lib/workitem/get_global_id.cl
rename to libclc/opencl/lib/generic/workitem/get_global_id.cl
index c1f384734e4d5..cd26995cbf0b5 100644
--- a/libclc/generic/lib/workitem/get_global_id.cl
+++ b/libclc/opencl/lib/generic/workitem/get_global_id.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_global_id(uint dim) {
   return get_group_id(dim) * get_local_size(dim) + get_local_id(dim) + get_global_offset(dim);
diff --git a/libclc/generic/lib/workitem/get_global_size.cl b/libclc/opencl/lib/generic/workitem/get_global_size.cl
similarity index 94%
rename from libclc/generic/lib/workitem/get_global_size.cl
rename to libclc/opencl/lib/generic/workitem/get_global_size.cl
index 909d2b013c95f..ed59dd6fcd4d0 100644
--- a/libclc/generic/lib/workitem/get_global_size.cl
+++ b/libclc/opencl/lib/generic/workitem/get_global_size.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_global_size(uint dim) {
   return get_num_groups(dim)*get_local_size(dim);
diff --git a/libclc/ptx-nvidiacl/lib/SOURCES b/libclc/opencl/lib/ptx-nvidiacl/SOURCES
similarity index 100%
rename from libclc/ptx-nvidiacl/lib/SOURCES
rename to libclc/opencl/lib/ptx-nvidiacl/SOURCES
diff --git a/libclc/ptx-nvidiacl/lib/mem_fence/fence.cl b/libclc/opencl/lib/ptx-nvidiacl/mem_fence/fence.cl
similarity index 96%
rename from libclc/ptx-nvidiacl/lib/mem_fence/fence.cl
rename to libclc/opencl/lib/ptx-nvidiacl/mem_fence/fence.cl
index 85ab3b427aaa9..284a0517d3308 100644
--- a/libclc/ptx-nvidiacl/lib/mem_fence/fence.cl
+++ b/libclc/opencl/lib/ptx-nvidiacl/mem_fence/fence.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD void mem_fence(cl_mem_fence_flags flags) {
   if (flags & (CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE))
diff --git a/libclc/ptx-nvidiacl/lib/synchronization/barrier.cl b/libclc/opencl/lib/ptx-nvidiacl/synchronization/barrier.cl
similarity index 94%
rename from libclc/ptx-nvidiacl/lib/synchronization/barrier.cl
rename to libclc/opencl/lib/ptx-nvidiacl/synchronization/barrier.cl
index e10e15f44f689..173d771ccaa39 100644
--- a/libclc/ptx-nvidiacl/lib/synchronization/barrier.cl
+++ b/libclc/opencl/lib/ptx-nvidiacl/synchronization/barrier.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD void barrier(cl_mem_fence_flags flags) {
   __syncthreads();
diff --git a/libclc/ptx-nvidiacl/lib/workitem/get_global_id.cl b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_global_id.cl
similarity index 94%
rename from libclc/ptx-nvidiacl/lib/workitem/get_global_id.cl
rename to libclc/opencl/lib/ptx-nvidiacl/workitem/get_global_id.cl
index 0db82fbb7ac68..2f1f7cd4250fe 100644
--- a/libclc/ptx-nvidiacl/lib/workitem/get_global_id.cl
+++ b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_global_id.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_global_id(uint dim) {
   return get_group_id(dim) * get_local_size(dim) + get_local_id(dim);
diff --git a/libclc/ptx-nvidiacl/lib/workitem/get_group_id.cl b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_group_id.cl
similarity index 95%
rename from libclc/ptx-nvidiacl/lib/workitem/get_group_id.cl
rename to libclc/opencl/lib/ptx-nvidiacl/workitem/get_group_id.cl
index b9908ccb78e83..dccd80c6ad6e7 100644
--- a/libclc/ptx-nvidiacl/lib/workitem/get_group_id.cl
+++ b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_group_id.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_group_id(uint dim) {
   switch (dim) {
diff --git a/libclc/ptx-nvidiacl/lib/workitem/get_local_id.cl b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_id.cl
similarity index 95%
rename from libclc/ptx-nvidiacl/lib/workitem/get_local_id.cl
rename to libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_id.cl
index 1b36032ca97b5..2756b4501606d 100644
--- a/libclc/ptx-nvidiacl/lib/workitem/get_local_id.cl
+++ b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_id.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_local_id(uint dim) {
   switch (dim) {
diff --git a/libclc/ptx-nvidiacl/lib/workitem/get_local_size.cl b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_size.cl
similarity index 95%
rename from libclc/ptx-nvidiacl/lib/workitem/get_local_size.cl
rename to libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_size.cl
index dee134e614f2a..ab5fc36094e58 100644
--- a/libclc/ptx-nvidiacl/lib/workitem/get_local_size.cl
+++ b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_size.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_local_size(uint dim) {
   switch (dim) {
diff --git a/libclc/ptx-nvidiacl/lib/workitem/get_num_groups.cl b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_num_groups.cl
similarity index 95%
rename from libclc/ptx-nvidiacl/lib/workitem/get_num_groups.cl
rename to libclc/opencl/lib/ptx-nvidiacl/workitem/get_num_groups.cl
index 25cae3c9716ea..0ee4b42e237bc 100644
--- a/libclc/ptx-nvidiacl/lib/workitem/get_num_groups.cl
+++ b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_num_groups.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_num_groups(uint dim) {
   switch (dim) {
diff --git a/libclc/r600/lib/SOURCES b/libclc/opencl/lib/r600/SOURCES
similarity index 100%
rename from libclc/r600/lib/SOURCES
rename to libclc/opencl/lib/r600/SOURCES
diff --git a/libclc/r600/lib/SOURCES_3.9 b/libclc/opencl/lib/r600/SOURCES_3.9
similarity index 100%
rename from libclc/r600/lib/SOURCES_3.9
rename to libclc/opencl/lib/r600/SOURCES_3.9
diff --git a/libclc/r600/lib/image/get_image_attributes_impl.ll b/libclc/opencl/lib/r600/image/get_image_attributes_impl.ll
similarity index 100%
rename from libclc/r600/lib/image/get_image_attributes_impl.ll
rename to libclc/opencl/lib/r600/image/get_image_attributes_impl.ll
diff --git a/libclc/r600/lib/image/get_image_channel_data_type.cl b/libclc/opencl/lib/r600/image/get_image_channel_data_type.cl
similarity index 96%
rename from libclc/r600/lib/image/get_image_channel_data_type.cl
rename to libclc/opencl/lib/r600/image/get_image_channel_data_type.cl
index d04cfd42a0588..252676abca737 100644
--- a/libclc/r600/lib/image/get_image_channel_data_type.cl
+++ b/libclc/opencl/lib/r600/image/get_image_channel_data_type.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL int __clc_get_image_channel_data_type_2d(image2d_t);
 _CLC_DECL int __clc_get_image_channel_data_type_3d(image3d_t);
diff --git a/libclc/r600/lib/image/get_image_channel_order.cl b/libclc/opencl/lib/r600/image/get_image_channel_order.cl
similarity index 96%
rename from libclc/r600/lib/image/get_image_channel_order.cl
rename to libclc/opencl/lib/r600/image/get_image_channel_order.cl
index 164804fa147c9..c9567dcb47378 100644
--- a/libclc/r600/lib/image/get_image_channel_order.cl
+++ b/libclc/opencl/lib/r600/image/get_image_channel_order.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL int __clc_get_image_channel_order_2d(image2d_t);
 _CLC_DECL int __clc_get_image_channel_order_3d(image3d_t);
diff --git a/libclc/r600/lib/image/get_image_depth.cl b/libclc/opencl/lib/r600/image/get_image_depth.cl
similarity index 94%
rename from libclc/r600/lib/image/get_image_depth.cl
rename to libclc/opencl/lib/r600/image/get_image_depth.cl
index dd4b3747172b4..af2809cefa113 100644
--- a/libclc/r600/lib/image/get_image_depth.cl
+++ b/libclc/opencl/lib/r600/image/get_image_depth.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL int __clc_get_image_depth_3d(image3d_t);
 
diff --git a/libclc/r600/lib/image/get_image_dim.cl b/libclc/opencl/lib/r600/image/get_image_dim.cl
similarity index 96%
rename from libclc/r600/lib/image/get_image_dim.cl
rename to libclc/opencl/lib/r600/image/get_image_dim.cl
index 1cb8d4d3a6dc0..899d9238713a0 100644
--- a/libclc/r600/lib/image/get_image_dim.cl
+++ b/libclc/opencl/lib/r600/image/get_image_dim.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_OVERLOAD _CLC_DEF int2 get_image_dim (image2d_t image) {
   return (int2)(get_image_width(image), get_image_height(image));
diff --git a/libclc/r600/lib/image/get_image_height.cl b/libclc/opencl/lib/r600/image/get_image_height.cl
similarity index 96%
rename from libclc/r600/lib/image/get_image_height.cl
rename to libclc/opencl/lib/r600/image/get_image_height.cl
index 2d869e3183147..f4d5371e24da9 100644
--- a/libclc/r600/lib/image/get_image_height.cl
+++ b/libclc/opencl/lib/r600/image/get_image_height.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL int __clc_get_image_height_2d(image2d_t);
 _CLC_DECL int __clc_get_image_height_3d(image3d_t);
diff --git a/libclc/r600/lib/image/get_image_width.cl b/libclc/opencl/lib/r600/image/get_image_width.cl
similarity index 96%
rename from libclc/r600/lib/image/get_image_width.cl
rename to libclc/opencl/lib/r600/image/get_image_width.cl
index a0c68f15e006a..69b61a5f451df 100644
--- a/libclc/r600/lib/image/get_image_width.cl
+++ b/libclc/opencl/lib/r600/image/get_image_width.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL int __clc_get_image_width_2d(image2d_t);
 _CLC_DECL int __clc_get_image_width_3d(image3d_t);
diff --git a/libclc/r600/lib/image/read_image_impl.ll b/libclc/opencl/lib/r600/image/read_image_impl.ll
similarity index 100%
rename from libclc/r600/lib/image/read_image_impl.ll
rename to libclc/opencl/lib/r600/image/read_image_impl.ll
diff --git a/libclc/r600/lib/image/read_imagef.cl b/libclc/opencl/lib/r600/image/read_imagef.cl
similarity index 96%
rename from libclc/r600/lib/image/read_imagef.cl
rename to libclc/opencl/lib/r600/image/read_imagef.cl
index 010f3cd59e1fb..54983363e33c5 100644
--- a/libclc/r600/lib/image/read_imagef.cl
+++ b/libclc/opencl/lib/r600/image/read_imagef.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL float4 __clc_read_imagef_tex(image2d_t, sampler_t, float2);
 
diff --git a/libclc/r600/lib/image/read_imagei.cl b/libclc/opencl/lib/r600/image/read_imagei.cl
similarity index 97%
rename from libclc/r600/lib/image/read_imagei.cl
rename to libclc/opencl/lib/r600/image/read_imagei.cl
index fbdf4f7f7c58a..dc76b7c8d0549 100644
--- a/libclc/r600/lib/image/read_imagei.cl
+++ b/libclc/opencl/lib/r600/image/read_imagei.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL float4 __clc_read_imagef_tex(image2d_t, sampler_t, float2);
 
diff --git a/libclc/r600/lib/image/read_imageui.cl b/libclc/opencl/lib/r600/image/read_imageui.cl
similarity index 97%
rename from libclc/r600/lib/image/read_imageui.cl
rename to libclc/opencl/lib/r600/image/read_imageui.cl
index bd0024776fe18..8dd1870732967 100644
--- a/libclc/r600/lib/image/read_imageui.cl
+++ b/libclc/opencl/lib/r600/image/read_imageui.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL float4 __clc_read_imagef_tex(image2d_t, sampler_t, float2);
 
diff --git a/libclc/r600/lib/image/write_image_impl.ll b/libclc/opencl/lib/r600/image/write_image_impl.ll
similarity index 100%
rename from libclc/r600/lib/image/write_image_impl.ll
rename to libclc/opencl/lib/r600/image/write_image_impl.ll
diff --git a/libclc/r600/lib/image/write_imagef.cl b/libclc/opencl/lib/r600/image/write_imagef.cl
similarity index 95%
rename from libclc/r600/lib/image/write_imagef.cl
rename to libclc/opencl/lib/r600/image/write_imagef.cl
index cd16dceb0f190..ea8a5f74ca3b4 100644
--- a/libclc/r600/lib/image/write_imagef.cl
+++ b/libclc/opencl/lib/r600/image/write_imagef.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL void __clc_write_imagef_2d(image2d_t image, int2 coord, float4 color);
 
diff --git a/libclc/r600/lib/image/write_imagei.cl b/libclc/opencl/lib/r600/image/write_imagei.cl
similarity index 95%
rename from libclc/r600/lib/image/write_imagei.cl
rename to libclc/opencl/lib/r600/image/write_imagei.cl
index dae95e0743a25..e89c5972c1657 100644
--- a/libclc/r600/lib/image/write_imagei.cl
+++ b/libclc/opencl/lib/r600/image/write_imagei.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL void __clc_write_imagei_2d(image2d_t image, int2 coord, int4 color);
 
diff --git a/libclc/r600/lib/image/write_imageui.cl b/libclc/opencl/lib/r600/image/write_imageui.cl
similarity index 95%
rename from libclc/r600/lib/image/write_imageui.cl
rename to libclc/opencl/lib/r600/image/write_imageui.cl
index 3524ad57e5b1c..0e047fa7bbf97 100644
--- a/libclc/r600/lib/image/write_imageui.cl
+++ b/libclc/opencl/lib/r600/image/write_imageui.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL void __clc_write_imageui_2d(image2d_t image, int2 coord, uint4 color);
 
diff --git a/libclc/r600/lib/synchronization/barrier.cl b/libclc/opencl/lib/r600/synchronization/barrier.cl
similarity index 95%
rename from libclc/r600/lib/synchronization/barrier.cl
rename to libclc/opencl/lib/r600/synchronization/barrier.cl
index c235be90b7f16..83438efa26498 100644
--- a/libclc/r600/lib/synchronization/barrier.cl
+++ b/libclc/opencl/lib/r600/synchronization/barrier.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF void __clc_r600_barrier(void) __asm("llvm.r600.group.barrier");
 
diff --git a/libclc/r600/lib/workitem/get_global_offset.cl b/libclc/opencl/lib/r600/workitem/get_global_offset.cl
similarity index 95%
rename from libclc/r600/lib/workitem/get_global_offset.cl
rename to libclc/opencl/lib/r600/workitem/get_global_offset.cl
index 1c47108df9a6a..cc42fe4beef0c 100644
--- a/libclc/r600/lib/workitem/get_global_offset.cl
+++ b/libclc/opencl/lib/r600/workitem/get_global_offset.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD uint get_global_offset(uint dim) {
   __attribute__((address_space(7))) uint *ptr =
diff --git a/libclc/r600/lib/workitem/get_global_size.cl b/libclc/opencl/lib/r600/workitem/get_global_size.cl
similarity index 96%
rename from libclc/r600/lib/workitem/get_global_size.cl
rename to libclc/opencl/lib/r600/workitem/get_global_size.cl
index b95accc8d830b..1c93568f80c74 100644
--- a/libclc/r600/lib/workitem/get_global_size.cl
+++ b/libclc/opencl/lib/r600/workitem/get_global_size.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 uint __clc_r600_get_global_size_x(void) __asm("llvm.r600.read.global.size.x");
 uint __clc_r600_get_global_size_y(void) __asm("llvm.r600.read.global.size.y");
diff --git a/libclc/r600/lib/workitem/get_group_id.cl b/libclc/opencl/lib/r600/workitem/get_group_id.cl
similarity index 95%
rename from libclc/r600/lib/workitem/get_group_id.cl
rename to libclc/opencl/lib/r600/workitem/get_group_id.cl
index b31431e903aed..c771e835cda12 100644
--- a/libclc/r600/lib/workitem/get_group_id.cl
+++ b/libclc/opencl/lib/r600/workitem/get_group_id.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD uint get_group_id(uint dim) {
   switch (dim) {
diff --git a/libclc/r600/lib/workitem/get_local_id.cl b/libclc/opencl/lib/r600/workitem/get_local_id.cl
similarity index 95%
rename from libclc/r600/lib/workitem/get_local_id.cl
rename to libclc/opencl/lib/r600/workitem/get_local_id.cl
index 2241715c2c70c..9d8e044812f24 100644
--- a/libclc/r600/lib/workitem/get_local_id.cl
+++ b/libclc/opencl/lib/r600/workitem/get_local_id.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD uint get_local_id(uint dim) {
   switch (dim) {
diff --git a/libclc/r600/lib/workitem/get_local_size.cl b/libclc/opencl/lib/r600/workitem/get_local_size.cl
similarity index 96%
rename from libclc/r600/lib/workitem/get_local_size.cl
rename to libclc/opencl/lib/r600/workitem/get_local_size.cl
index 97e6b41ca7c6a..3755cf5e8b0e6 100644
--- a/libclc/r600/lib/workitem/get_local_size.cl
+++ b/libclc/opencl/lib/r600/workitem/get_local_size.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 uint __clc_r600_get_local_size_x(void) __asm("llvm.r600.read.local.size.x");
 uint __clc_r600_get_local_size_y(void) __asm("llvm.r600.read.local.size.y");
diff --git a/libclc/r600/lib/workitem/get_num_groups.cl b/libclc/opencl/lib/r600/workitem/get_num_groups.cl
similarity index 96%
rename from libclc/r600/lib/workitem/get_num_groups.cl
rename to libclc/opencl/lib/r600/workitem/get_num_groups.cl
index 564189daf4fbd..088a055aabfce 100644
--- a/libclc/r600/lib/workitem/get_num_groups.cl
+++ b/libclc/opencl/lib/r600/workitem/get_num_groups.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 uint __clc_r600_get_num_groups_x(void) __asm("llvm.r600.read.ngroups.x");
 uint __clc_r600_get_num_groups_y(void) __asm("llvm.r600.read.ngroups.y");
diff --git a/libclc/r600/lib/workitem/get_work_dim.cl b/libclc/opencl/lib/r600/workitem/get_work_dim.cl
similarity index 95%
rename from libclc/r600/lib/workitem/get_work_dim.cl
rename to libclc/opencl/lib/r600/workitem/get_work_dim.cl
index 0fadbe34e17d6..b59dd3af6c334 100644
--- a/libclc/r600/lib/workitem/get_work_dim.cl
+++ b/libclc/opencl/lib/r600/workitem/get_work_dim.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD uint get_work_dim(void) {
   __attribute__((address_space(7))) uint *ptr =
diff --git a/libclc/opencl/lib/spirv/SOURCES b/libclc/opencl/lib/spirv/SOURCES
new file mode 100644
index 0000000000000..0aa923978e9f1
--- /dev/null
+++ b/libclc/opencl/lib/spirv/SOURCES
@@ -0,0 +1,73 @@
+subnormal_config.cl
+../generic/async/async_work_group_strided_copy.cl
+../generic/async/wait_group_events.cl
+../generic/common/degrees.cl
+../generic/common/mix.cl
+../generic/common/radians.cl
+../generic/common/sign.cl
+../generic/common/smoothstep.cl
+../generic/common/step.cl
+../generic/geometric/cross.cl
+../generic/geometric/distance.cl
+../generic/geometric/dot.cl
+../generic/geometric/fast_distance.cl
+../generic/geometric/fast_length.cl
+../generic/geometric/fast_normalize.cl
+../generic/geometric/length.cl
+../generic/geometric/normalize.cl
+../generic/integer/rotate.cl
+../generic/integer/mad_sat.cl
+../generic/math/acos.cl
+../generic/math/acosh.cl
+../generic/math/acospi.cl
+../generic/math/asin.cl
+../generic/math/asinh.cl
+../generic/math/asinpi.cl
+../generic/math/atan.cl
+../generic/math/atan2.cl
+../generic/math/atan2pi.cl
+../generic/math/atanh.cl
+../generic/math/atanpi.cl
+../generic/math/cbrt.cl
+../generic/math/cos.cl
+../generic/math/cosh.cl
+../generic/math/cospi.cl
+../generic/math/erf.cl
+../generic/math/erfc.cl
+../generic/math/exp.cl
+../generic/math/expm1.cl
+../generic/math/exp2.cl
+../generic/math/exp10.cl
+math/fma.cl
+../generic/math/fmod.cl
+../generic/math/fract.cl
+../generic/math/frexp.cl
+../generic/math/half_rsqrt.cl
+../generic/math/half_sqrt.cl
+../generic/math/hypot.cl
+../generic/math/ilogb.cl
+../generic/math/ldexp.cl
+../generic/math/lgamma.cl
+../generic/math/lgamma_r.cl
+../generic/math/log.cl
+../generic/math/log10.cl
+../generic/math/log1p.cl
+../generic/math/log2.cl
+../generic/math/logb.cl
+../generic/math/modf.cl
+../generic/math/pow.cl
+../generic/math/pown.cl
+../generic/math/powr.cl
+../generic/math/remainder.cl
+../generic/math/remquo.cl
+../generic/math/rootn.cl
+../generic/math/sin.cl
+../generic/math/sincos.cl
+../generic/math/sinh.cl
+../generic/math/sinpi.cl
+../generic/math/tan.cl
+../generic/math/tanh.cl
+../generic/math/tanpi.cl
+../generic/math/tgamma.cl
+../generic/shared/vload.cl
+../generic/shared/vstore.cl
diff --git a/libclc/clspv/lib/math/fma.cl b/libclc/opencl/lib/spirv/math/fma.cl
similarity index 94%
rename from libclc/clspv/lib/math/fma.cl
rename to libclc/opencl/lib/spirv/math/fma.cl
index 0f3e4222dc557..014e311ff91a4 100644
--- a/libclc/clspv/lib/math/fma.cl
+++ b/libclc/opencl/lib/spirv/math/fma.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/internal/math/clc_sw_fma.h>
 
diff --git a/libclc/spirv/lib/subnormal_config.cl b/libclc/opencl/lib/spirv/subnormal_config.cl
similarity index 95%
rename from libclc/spirv/lib/subnormal_config.cl
rename to libclc/opencl/lib/spirv/subnormal_config.cl
index ef0e1d7742447..50997134bcd99 100644
--- a/libclc/spirv/lib/subnormal_config.cl
+++ b/libclc/opencl/lib/spirv/subnormal_config.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/math/clc_subnormal_config.h>
 
 _CLC_DEF bool __clc_fp16_subnormals_supported() { return false; }
diff --git a/libclc/spirv/lib/SOURCES b/libclc/spirv/lib/SOURCES
deleted file mode 100644
index f3852ebe3e3e6..0000000000000
--- a/libclc/spirv/lib/SOURCES
+++ /dev/null
@@ -1,73 +0,0 @@
-subnormal_config.cl
-../../generic/lib/async/async_work_group_strided_copy.cl
-../../generic/lib/async/wait_group_events.cl
-../../generic/lib/common/degrees.cl
-../../generic/lib/common/mix.cl
-../../generic/lib/common/radians.cl
-../../generic/lib/common/sign.cl
-../../generic/lib/common/smoothstep.cl
-../../generic/lib/common/step.cl
-../../generic/lib/geometric/cross.cl
-../../generic/lib/geometric/distance.cl
-../../generic/lib/geometric/dot.cl
-../../generic/lib/geometric/fast_distance.cl
-../../generic/lib/geometric/fast_length.cl
-../../generic/lib/geometric/fast_normalize.cl
-../../generic/lib/geometric/length.cl
-../../generic/lib/geometric/normalize.cl
-../../generic/lib/integer/rotate.cl
-../../generic/lib/integer/mad_sat.cl
-../../generic/lib/math/acos.cl
-../../generic/lib/math/acosh.cl
-../../generic/lib/math/acospi.cl
-../../generic/lib/math/asin.cl
-../../generic/lib/math/asinh.cl
-../../generic/lib/math/asinpi.cl
-../../generic/lib/math/atan.cl
-../../generic/lib/math/atan2.cl
-../../generic/lib/math/atan2pi.cl
-../../generic/lib/math/atanh.cl
-../../generic/lib/math/atanpi.cl
-../../generic/lib/math/cbrt.cl
-../../generic/lib/math/cos.cl
-../../generic/lib/math/cosh.cl
-../../generic/lib/math/cospi.cl
-../../generic/lib/math/erf.cl
-../../generic/lib/math/erfc.cl
-../../generic/lib/math/exp.cl
-../../generic/lib/math/expm1.cl
-../../generic/lib/math/exp2.cl
-../../generic/lib/math/exp10.cl
-math/fma.cl
-../../generic/lib/math/fmod.cl
-../../generic/lib/math/fract.cl
-../../generic/lib/math/frexp.cl
-../../generic/lib/math/half_rsqrt.cl
-../../generic/lib/math/half_sqrt.cl
-../../generic/lib/math/hypot.cl
-../../generic/lib/math/ilogb.cl
-../../generic/lib/math/ldexp.cl
-../../generic/lib/math/lgamma.cl
-../../generic/lib/math/lgamma_r.cl
-../../generic/lib/math/log.cl
-../../generic/lib/math/log10.cl
-../../generic/lib/math/log1p.cl
-../../generic/lib/math/log2.cl
-../../generic/lib/math/logb.cl
-../../generic/lib/math/modf.cl
-../../generic/lib/math/pow.cl
-../../generic/lib/math/pown.cl
-../../generic/lib/math/powr.cl
-../../generic/lib/math/remainder.cl
-../../generic/lib/math/remquo.cl
-../../generic/lib/math/rootn.cl
-../../generic/lib/math/sin.cl
-../../generic/lib/math/sincos.cl
-../../generic/lib/math/sinh.cl
-../../generic/lib/math/sinpi.cl
-../../generic/lib/math/tan.cl
-../../generic/lib/math/tanh.cl
-../../generic/lib/math/tanpi.cl
-../../generic/lib/math/tgamma.cl
-../../generic/lib/shared/vload.cl
-../../generic/lib/shared/vstore.cl
diff --git a/libclc/generic/lib/gen_convert.py b/libclc/utils/gen_convert.py
similarity index 99%
rename from libclc/generic/lib/gen_convert.py
rename to libclc/utils/gen_convert.py
index b8c7050095fc8..21e297cb25b73 100644
--- a/libclc/generic/lib/gen_convert.py
+++ b/libclc/utils/gen_convert.py
@@ -167,7 +167,7 @@ def conditional_guard(src, dst):
 nl = "\n"
 includes = []
 if not clc:
-    includes = ["<clc/clc.h>"]
+    includes = ["<clc/opencl/clc.h>"]
 else:
     includes = sorted(
         [

>From c682f80fdd6a078e35087dae10a44c2e8cd57108 Mon Sep 17 00:00:00 2001
From: Fraser Cormack <fraser at codeplay.com>
Date: Mon, 19 May 2025 16:08:33 +0100
Subject: [PATCH 2/3] fix formatting

---
 .../opencl/async/async_work_group_copy.inc    |  9 +--
 .../async/async_work_group_strided_copy.inc   |  8 +-
 .../include/clc/opencl/async/prefetch.inc     |  3 +-
 .../clc/opencl/atomic/atomic_cmpxchg.h        |  8 +-
 .../include/clc/opencl/atomic/atomic_dec.h    |  8 +-
 .../include/clc/opencl/atomic/atomic_decl.inc | 10 +--
 .../include/clc/opencl/atomic/atomic_inc.h    |  8 +-
 .../include/clc/opencl/atomic/atomic_xchg.h   |  4 +-
 libclc/opencl/include/clc/opencl/clc.h        | 48 ++++++------
 .../opencl/include/clc/opencl/common/mix.inc  |  6 +-
 .../include/clc/opencl/common/smoothstep.inc  | 10 ++-
 .../opencl/include/clc/opencl/image/image.h   | 72 ++++++++---------
 .../include/clc/opencl/image/image_defines.h  | 78 +++++++++----------
 .../include/clc/opencl/integer/abs_diff.inc   |  3 +-
 libclc/opencl/include/clc/opencl/math/fmax.h  |  1 -
 libclc/opencl/include/clc/opencl/math/fmin.h  |  1 -
 .../opencl/include/clc/opencl/math/frexp.inc  |  9 ++-
 .../opencl/include/clc/opencl/misc/shuffle2.h | 28 +++----
 .../include/clc/opencl/relational/all.h       | 15 ++--
 .../include/clc/opencl/relational/any.h       | 15 ++--
 .../clc/opencl/relational/bitselect.inc       |  4 +-
 .../include/clc/opencl/relational/isequal.h   | 12 +--
 .../include/clc/opencl/relational/isinf.h     | 12 +--
 .../include/clc/opencl/relational/isnan.h     | 12 +--
 .../include/clc/opencl/shared/clamp.inc       |  7 +-
 .../opencl/include/clc/opencl/shared/max.inc  |  3 +-
 .../opencl/include/clc/opencl/shared/min.inc  |  3 +-
 .../amdgcn-amdhsa/workitem/get_global_size.cl |  3 +-
 .../amdgcn-amdhsa/workitem/get_local_size.cl  |  3 +-
 .../amdgcn-amdhsa/workitem/get_num_groups.cl  |  1 -
 libclc/opencl/lib/amdgcn/mem_fence/fence.cl   |  6 +-
 libclc/opencl/lib/clspv/math/fma.cl           |  2 +-
 libclc/opencl/lib/clspv/subnormal_config.cl   |  2 +-
 .../generic/async/async_work_group_copy.inc   | 16 ++--
 .../async/async_work_group_strided_copy.inc   | 32 +++-----
 libclc/opencl/lib/generic/async/prefetch.inc  |  3 +-
 .../opencl/lib/generic/atomic/atomic_add.cl   |  8 +-
 .../opencl/lib/generic/atomic/atomic_and.cl   |  8 +-
 .../lib/generic/atomic/atomic_cmpxchg.cl      |  9 ++-
 .../opencl/lib/generic/atomic/atomic_dec.cl   |  8 +-
 .../opencl/lib/generic/atomic/atomic_inc.cl   |  8 +-
 .../opencl/lib/generic/atomic/atomic_max.cl   |  8 +-
 .../opencl/lib/generic/atomic/atomic_min.cl   |  8 +-
 libclc/opencl/lib/generic/atomic/atomic_or.cl |  8 +-
 .../opencl/lib/generic/atomic/atomic_sub.cl   |  8 +-
 .../opencl/lib/generic/atomic/atomic_xchg.cl  |  8 +-
 .../opencl/lib/generic/atomic/atomic_xor.cl   |  8 +-
 libclc/opencl/lib/generic/common/degrees.cl   |  2 +-
 libclc/opencl/lib/generic/common/mix.cl       |  2 +-
 libclc/opencl/lib/generic/common/radians.cl   |  2 +-
 libclc/opencl/lib/generic/common/sign.cl      |  2 +-
 .../opencl/lib/generic/common/smoothstep.cl   |  2 +-
 libclc/opencl/lib/generic/common/step.cl      | 10 +--
 libclc/opencl/lib/generic/geometric/cross.cl  |  2 +-
 .../opencl/lib/generic/geometric/distance.cl  |  2 +-
 libclc/opencl/lib/generic/geometric/dot.cl    |  2 +-
 .../lib/generic/geometric/fast_distance.cl    |  2 +-
 .../lib/generic/geometric/fast_length.cl      |  2 +-
 .../lib/generic/geometric/fast_normalize.cl   |  4 +-
 libclc/opencl/lib/generic/geometric/length.cl |  2 +-
 .../opencl/lib/generic/geometric/normalize.cl |  8 +-
 libclc/opencl/lib/generic/integer/abs.cl      |  2 +-
 libclc/opencl/lib/generic/integer/abs_diff.cl |  2 +-
 .../opencl/lib/generic/integer/abs_diff.inc   |  3 +-
 libclc/opencl/lib/generic/integer/add_sat.cl  |  2 +-
 libclc/opencl/lib/generic/integer/clz.cl      |  2 +-
 libclc/opencl/lib/generic/integer/ctz.cl      |  2 +-
 libclc/opencl/lib/generic/integer/hadd.cl     |  2 +-
 libclc/opencl/lib/generic/integer/mad24.cl    |  2 +-
 libclc/opencl/lib/generic/integer/mad_hi.cl   |  2 +-
 libclc/opencl/lib/generic/integer/mad_sat.cl  |  2 +-
 libclc/opencl/lib/generic/integer/mul24.cl    |  2 +-
 libclc/opencl/lib/generic/integer/mul_hi.cl   |  2 +-
 libclc/opencl/lib/generic/integer/popcount.cl |  2 +-
 libclc/opencl/lib/generic/integer/rhadd.cl    |  2 +-
 libclc/opencl/lib/generic/integer/rotate.cl   |  2 +-
 libclc/opencl/lib/generic/integer/sub_sat.cl  |  2 +-
 libclc/opencl/lib/generic/integer/upsample.cl |  2 +-
 libclc/opencl/lib/generic/math/acos.cl        |  2 +-
 libclc/opencl/lib/generic/math/acosh.cl       |  2 +-
 libclc/opencl/lib/generic/math/acospi.cl      |  2 +-
 libclc/opencl/lib/generic/math/asin.cl        |  2 +-
 libclc/opencl/lib/generic/math/asinh.cl       |  2 +-
 libclc/opencl/lib/generic/math/asinpi.cl      |  2 +-
 libclc/opencl/lib/generic/math/atan.cl        |  2 +-
 libclc/opencl/lib/generic/math/atan2.cl       |  2 +-
 libclc/opencl/lib/generic/math/atan2pi.cl     |  2 +-
 libclc/opencl/lib/generic/math/atanh.cl       |  2 +-
 libclc/opencl/lib/generic/math/atanpi.cl      |  2 +-
 libclc/opencl/lib/generic/math/cbrt.cl        |  2 +-
 libclc/opencl/lib/generic/math/ceil.cl        |  2 +-
 libclc/opencl/lib/generic/math/copysign.cl    |  2 +-
 libclc/opencl/lib/generic/math/cos.cl         |  2 +-
 libclc/opencl/lib/generic/math/cosh.cl        |  2 +-
 libclc/opencl/lib/generic/math/cospi.cl       |  2 +-
 libclc/opencl/lib/generic/math/erf.cl         |  2 +-
 libclc/opencl/lib/generic/math/erfc.cl        |  2 +-
 libclc/opencl/lib/generic/math/exp.cl         |  2 +-
 libclc/opencl/lib/generic/math/exp10.cl       |  2 +-
 libclc/opencl/lib/generic/math/exp2.cl        |  2 +-
 libclc/opencl/lib/generic/math/expm1.cl       |  2 +-
 libclc/opencl/lib/generic/math/fabs.cl        |  2 +-
 libclc/opencl/lib/generic/math/fdim.cl        |  2 +-
 libclc/opencl/lib/generic/math/floor.cl       |  2 +-
 libclc/opencl/lib/generic/math/fma.cl         |  2 +-
 libclc/opencl/lib/generic/math/fmax.cl        |  2 +-
 libclc/opencl/lib/generic/math/fmin.cl        |  2 +-
 libclc/opencl/lib/generic/math/fmod.cl        |  2 +-
 libclc/opencl/lib/generic/math/fract.cl       |  2 +-
 libclc/opencl/lib/generic/math/frexp.cl       |  2 +-
 libclc/opencl/lib/generic/math/half_cos.cl    |  2 +-
 libclc/opencl/lib/generic/math/half_divide.cl |  2 +-
 libclc/opencl/lib/generic/math/half_exp.cl    |  2 +-
 libclc/opencl/lib/generic/math/half_exp10.cl  |  2 +-
 libclc/opencl/lib/generic/math/half_exp2.cl   |  2 +-
 libclc/opencl/lib/generic/math/half_log.cl    |  2 +-
 libclc/opencl/lib/generic/math/half_log10.cl  |  2 +-
 libclc/opencl/lib/generic/math/half_log2.cl   |  2 +-
 libclc/opencl/lib/generic/math/half_powr.cl   |  2 +-
 libclc/opencl/lib/generic/math/half_recip.cl  |  2 +-
 libclc/opencl/lib/generic/math/half_rsqrt.cl  |  2 +-
 libclc/opencl/lib/generic/math/half_sin.cl    |  2 +-
 libclc/opencl/lib/generic/math/half_sqrt.cl   |  2 +-
 libclc/opencl/lib/generic/math/half_tan.cl    |  2 +-
 libclc/opencl/lib/generic/math/hypot.cl       |  2 +-
 libclc/opencl/lib/generic/math/ilogb.cl       |  2 +-
 libclc/opencl/lib/generic/math/ldexp.cl       |  2 +-
 libclc/opencl/lib/generic/math/lgamma.cl      |  2 +-
 libclc/opencl/lib/generic/math/lgamma_r.cl    |  2 +-
 libclc/opencl/lib/generic/math/log.cl         |  2 +-
 libclc/opencl/lib/generic/math/log10.cl       |  2 +-
 libclc/opencl/lib/generic/math/log1p.cl       |  2 +-
 libclc/opencl/lib/generic/math/log2.cl        |  2 +-
 libclc/opencl/lib/generic/math/logb.cl        |  2 +-
 libclc/opencl/lib/generic/math/mad.cl         |  2 +-
 libclc/opencl/lib/generic/math/maxmag.cl      |  2 +-
 libclc/opencl/lib/generic/math/minmag.cl      |  2 +-
 libclc/opencl/lib/generic/math/modf.cl        |  2 +-
 libclc/opencl/lib/generic/math/native_cos.cl  |  2 +-
 .../opencl/lib/generic/math/native_divide.cl  |  2 +-
 libclc/opencl/lib/generic/math/native_exp.cl  |  2 +-
 .../opencl/lib/generic/math/native_exp10.cl   |  2 +-
 libclc/opencl/lib/generic/math/native_exp2.cl |  2 +-
 libclc/opencl/lib/generic/math/native_log.cl  |  2 +-
 .../opencl/lib/generic/math/native_log10.cl   |  2 +-
 libclc/opencl/lib/generic/math/native_log2.cl |  2 +-
 libclc/opencl/lib/generic/math/native_powr.cl |  2 +-
 .../opencl/lib/generic/math/native_recip.cl   |  2 +-
 .../opencl/lib/generic/math/native_rsqrt.cl   |  2 +-
 libclc/opencl/lib/generic/math/native_sin.cl  |  2 +-
 libclc/opencl/lib/generic/math/native_sqrt.cl |  2 +-
 libclc/opencl/lib/generic/math/native_tan.cl  |  2 +-
 libclc/opencl/lib/generic/math/nextafter.cl   |  2 +-
 libclc/opencl/lib/generic/math/pow.cl         |  2 +-
 libclc/opencl/lib/generic/math/pown.cl        |  2 +-
 libclc/opencl/lib/generic/math/powr.cl        |  2 +-
 libclc/opencl/lib/generic/math/remainder.cl   |  2 +-
 libclc/opencl/lib/generic/math/remquo.cl      |  2 +-
 libclc/opencl/lib/generic/math/rint.cl        |  2 +-
 libclc/opencl/lib/generic/math/rootn.cl       |  2 +-
 libclc/opencl/lib/generic/math/round.cl       |  2 +-
 libclc/opencl/lib/generic/math/rsqrt.cl       |  2 +-
 libclc/opencl/lib/generic/math/sin.cl         |  2 +-
 libclc/opencl/lib/generic/math/sincos.cl      |  2 +-
 libclc/opencl/lib/generic/math/sinh.cl        |  2 +-
 libclc/opencl/lib/generic/math/sinpi.cl       |  2 +-
 libclc/opencl/lib/generic/math/sqrt.cl        |  2 +-
 libclc/opencl/lib/generic/math/tan.cl         |  2 +-
 libclc/opencl/lib/generic/math/tanh.cl        |  2 +-
 libclc/opencl/lib/generic/math/tanpi.cl       |  2 +-
 libclc/opencl/lib/generic/math/tgamma.cl      |  2 +-
 libclc/opencl/lib/generic/math/trunc.cl       |  2 +-
 libclc/opencl/lib/generic/misc/shuffle.cl     |  2 +-
 libclc/opencl/lib/generic/misc/shuffle2.cl    |  2 +-
 libclc/opencl/lib/generic/shared/clamp.inc    |  7 +-
 libclc/opencl/lib/generic/subnormal_config.cl | 10 +--
 .../lib/generic/workitem/get_global_id.cl     |  3 +-
 .../lib/generic/workitem/get_global_size.cl   |  2 +-
 .../lib/ptx-nvidiacl/workitem/get_group_id.cl | 12 ++-
 .../lib/ptx-nvidiacl/workitem/get_local_id.cl | 12 ++-
 .../ptx-nvidiacl/workitem/get_local_size.cl   | 12 ++-
 .../ptx-nvidiacl/workitem/get_num_groups.cl   | 12 ++-
 .../r600/image/get_image_channel_data_type.cl |  6 +-
 .../lib/r600/image/get_image_channel_order.cl |  6 +-
 .../opencl/lib/r600/image/get_image_depth.cl  |  5 +-
 libclc/opencl/lib/r600/image/get_image_dim.cl |  4 +-
 .../opencl/lib/r600/image/get_image_height.cl |  6 +-
 .../opencl/lib/r600/image/get_image_width.cl  |  6 +-
 libclc/opencl/lib/r600/image/read_imagei.cl   |  6 +-
 libclc/opencl/lib/r600/image/read_imageui.cl  |  6 +-
 libclc/opencl/lib/r600/image/write_imagef.cl  |  5 +-
 libclc/opencl/lib/r600/image/write_imagei.cl  |  5 +-
 libclc/opencl/lib/r600/image/write_imageui.cl |  5 +-
 .../lib/r600/workitem/get_global_offset.cl    |  5 +-
 .../opencl/lib/r600/workitem/get_work_dim.cl  |  5 +-
 libclc/opencl/lib/spirv/math/fma.cl           |  2 +-
 libclc/opencl/lib/spirv/subnormal_config.cl   |  2 +-
 197 files changed, 484 insertions(+), 485 deletions(-)

diff --git a/libclc/opencl/include/clc/opencl/async/async_work_group_copy.inc b/libclc/opencl/include/clc/opencl/async/async_work_group_copy.inc
index 502c79f410df6..cc4174970cb25 100644
--- a/libclc/opencl/include/clc/opencl/async/async_work_group_copy.inc
+++ b/libclc/opencl/include/clc/opencl/async/async_work_group_copy.inc
@@ -6,8 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DECL event_t async_work_group_copy(
-  __CLC_DST_ADDR_SPACE __CLC_GENTYPE *dst,
-  const __CLC_SRC_ADDR_SPACE __CLC_GENTYPE *src,
-  size_t num_gentypes,
-  event_t event);
+_CLC_OVERLOAD _CLC_DECL event_t
+async_work_group_copy(__CLC_DST_ADDR_SPACE __CLC_GENTYPE *dst,
+                      const __CLC_SRC_ADDR_SPACE __CLC_GENTYPE *src,
+                      size_t num_gentypes, event_t event);
diff --git a/libclc/opencl/include/clc/opencl/async/async_work_group_strided_copy.inc b/libclc/opencl/include/clc/opencl/async/async_work_group_strided_copy.inc
index d5a582d9ab906..9df894e4fa29e 100644
--- a/libclc/opencl/include/clc/opencl/async/async_work_group_strided_copy.inc
+++ b/libclc/opencl/include/clc/opencl/async/async_work_group_strided_copy.inc
@@ -7,8 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 _CLC_OVERLOAD _CLC_DECL event_t async_work_group_strided_copy(
-  __CLC_DST_ADDR_SPACE __CLC_GENTYPE *dst,
-  const __CLC_SRC_ADDR_SPACE __CLC_GENTYPE *src,
-  size_t num_gentypes,
-  size_t stride,
-  event_t event);
+    __CLC_DST_ADDR_SPACE __CLC_GENTYPE *dst,
+    const __CLC_SRC_ADDR_SPACE __CLC_GENTYPE *src, size_t num_gentypes,
+    size_t stride, event_t event);
diff --git a/libclc/opencl/include/clc/opencl/async/prefetch.inc b/libclc/opencl/include/clc/opencl/async/prefetch.inc
index 6439e721a0b3d..4a78778fa7604 100644
--- a/libclc/opencl/include/clc/opencl/async/prefetch.inc
+++ b/libclc/opencl/include/clc/opencl/async/prefetch.inc
@@ -6,4 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DECL void prefetch(const global __CLC_GENTYPE *p, size_t num_gentypes);
+_CLC_OVERLOAD _CLC_DECL void prefetch(const global __CLC_GENTYPE *p,
+                                      size_t num_gentypes);
diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_cmpxchg.h b/libclc/opencl/include/clc/opencl/atomic/atomic_cmpxchg.h
index f49269777564b..fc7975910cb24 100644
--- a/libclc/opencl/include/clc/opencl/atomic/atomic_cmpxchg.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_cmpxchg.h
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DECL int atomic_cmpxchg (volatile local int *, int, int);
-_CLC_OVERLOAD _CLC_DECL int atomic_cmpxchg (volatile global int *, int, int);
-_CLC_OVERLOAD _CLC_DECL uint atomic_cmpxchg (volatile local uint *, uint, uint);
-_CLC_OVERLOAD _CLC_DECL uint atomic_cmpxchg (volatile global uint *, uint, uint);
+_CLC_OVERLOAD _CLC_DECL int atomic_cmpxchg(volatile local int *, int, int);
+_CLC_OVERLOAD _CLC_DECL int atomic_cmpxchg(volatile global int *, int, int);
+_CLC_OVERLOAD _CLC_DECL uint atomic_cmpxchg(volatile local uint *, uint, uint);
+_CLC_OVERLOAD _CLC_DECL uint atomic_cmpxchg(volatile global uint *, uint, uint);
diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_dec.h b/libclc/opencl/include/clc/opencl/atomic/atomic_dec.h
index aca1b95926a20..354a721003f56 100644
--- a/libclc/opencl/include/clc/opencl/atomic/atomic_dec.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_dec.h
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DECL int atomic_dec (volatile local int *);
-_CLC_OVERLOAD _CLC_DECL int atomic_dec (volatile global int *);
-_CLC_OVERLOAD _CLC_DECL uint atomic_dec (volatile local uint *);
-_CLC_OVERLOAD _CLC_DECL uint atomic_dec (volatile global uint *);
+_CLC_OVERLOAD _CLC_DECL int atomic_dec(volatile local int *);
+_CLC_OVERLOAD _CLC_DECL int atomic_dec(volatile global int *);
+_CLC_OVERLOAD _CLC_DECL uint atomic_dec(volatile local uint *);
+_CLC_OVERLOAD _CLC_DECL uint atomic_dec(volatile global uint *);
diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_decl.inc b/libclc/opencl/include/clc/opencl/atomic/atomic_decl.inc
index b6540b37d1ab8..0cfd4c3eab5f6 100644
--- a/libclc/opencl/include/clc/opencl/atomic/atomic_decl.inc
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_decl.inc
@@ -6,12 +6,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_DECLARE_ATOMIC(ADDRSPACE, TYPE) \
-	_CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION (volatile ADDRSPACE TYPE *, TYPE);
+#define __CLC_DECLARE_ATOMIC(ADDRSPACE, TYPE)                                  \
+  _CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION(volatile ADDRSPACE TYPE *, TYPE);
 
-#define __CLC_DECLARE_ATOMIC_ADDRSPACE(TYPE) \
-	__CLC_DECLARE_ATOMIC(global, TYPE) \
-	__CLC_DECLARE_ATOMIC(local, TYPE)
+#define __CLC_DECLARE_ATOMIC_ADDRSPACE(TYPE)                                   \
+  __CLC_DECLARE_ATOMIC(global, TYPE)                                           \
+  __CLC_DECLARE_ATOMIC(local, TYPE)
 
 __CLC_DECLARE_ATOMIC_ADDRSPACE(int)
 __CLC_DECLARE_ATOMIC_ADDRSPACE(uint)
diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_inc.h b/libclc/opencl/include/clc/opencl/atomic/atomic_inc.h
index daf1d8feb2c53..2b81c23bf0e5e 100644
--- a/libclc/opencl/include/clc/opencl/atomic/atomic_inc.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_inc.h
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DECL int atomic_inc (volatile local int *);
-_CLC_OVERLOAD _CLC_DECL int atomic_inc (volatile global int *);
-_CLC_OVERLOAD _CLC_DECL uint atomic_inc (volatile local uint *);
-_CLC_OVERLOAD _CLC_DECL uint atomic_inc (volatile global uint *);
+_CLC_OVERLOAD _CLC_DECL int atomic_inc(volatile local int *);
+_CLC_OVERLOAD _CLC_DECL int atomic_inc(volatile global int *);
+_CLC_OVERLOAD _CLC_DECL uint atomic_inc(volatile local uint *);
+_CLC_OVERLOAD _CLC_DECL uint atomic_inc(volatile global uint *);
diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_xchg.h b/libclc/opencl/include/clc/opencl/atomic/atomic_xchg.h
index efad65567aae3..ec322d56e23d1 100644
--- a/libclc/opencl/include/clc/opencl/atomic/atomic_xchg.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_xchg.h
@@ -8,6 +8,6 @@
 
 #define __CLC_FUNCTION atomic_xchg
 
-_CLC_OVERLOAD _CLC_DECL float __CLC_FUNCTION (volatile local float *, float);
-_CLC_OVERLOAD _CLC_DECL float __CLC_FUNCTION (volatile global float *, float);
+_CLC_OVERLOAD _CLC_DECL float __CLC_FUNCTION(volatile local float *, float);
+_CLC_OVERLOAD _CLC_DECL float __CLC_FUNCTION(volatile global float *, float);
 #include <clc/opencl/atomic/atomic_decl.inc>
diff --git a/libclc/opencl/include/clc/opencl/clc.h b/libclc/opencl/include/clc/opencl/clc.h
index c23ad3354fd2d..0116a12932c9f 100644
--- a/libclc/opencl/include/clc/opencl/clc.h
+++ b/libclc/opencl/include/clc/opencl/clc.h
@@ -36,13 +36,13 @@
 #include <clc/opencl/as_type.h>
 
 /* 6.11.1 Work-Item Functions */
-#include <clc/opencl/workitem/get_global_size.h>
 #include <clc/opencl/workitem/get_global_id.h>
-#include <clc/opencl/workitem/get_local_size.h>
+#include <clc/opencl/workitem/get_global_offset.h>
+#include <clc/opencl/workitem/get_global_size.h>
+#include <clc/opencl/workitem/get_group_id.h>
 #include <clc/opencl/workitem/get_local_id.h>
+#include <clc/opencl/workitem/get_local_size.h>
 #include <clc/opencl/workitem/get_num_groups.h>
-#include <clc/opencl/workitem/get_group_id.h>
-#include <clc/opencl/workitem/get_global_offset.h>
 #include <clc/opencl/workitem/get_work_dim.h>
 
 /* 6.11.2 Math Functions */
@@ -58,17 +58,17 @@
 #include <clc/opencl/math/atanh.h>
 #include <clc/opencl/math/atanpi.h>
 #include <clc/opencl/math/cbrt.h>
+#include <clc/opencl/math/ceil.h>
 #include <clc/opencl/math/copysign.h>
 #include <clc/opencl/math/cos.h>
 #include <clc/opencl/math/cosh.h>
 #include <clc/opencl/math/cospi.h>
-#include <clc/opencl/math/ceil.h>
 #include <clc/opencl/math/erf.h>
 #include <clc/opencl/math/erfc.h>
 #include <clc/opencl/math/exp.h>
-#include <clc/opencl/math/expm1.h>
 #include <clc/opencl/math/exp10.h>
 #include <clc/opencl/math/exp2.h>
+#include <clc/opencl/math/expm1.h>
 #include <clc/opencl/math/fabs.h>
 #include <clc/opencl/math/fdim.h>
 #include <clc/opencl/math/floor.h>
@@ -107,6 +107,20 @@
 #include <clc/opencl/math/minmag.h>
 #include <clc/opencl/math/modf.h>
 #include <clc/opencl/math/nan.h>
+#include <clc/opencl/math/native_cos.h>
+#include <clc/opencl/math/native_divide.h>
+#include <clc/opencl/math/native_exp.h>
+#include <clc/opencl/math/native_exp10.h>
+#include <clc/opencl/math/native_exp2.h>
+#include <clc/opencl/math/native_log.h>
+#include <clc/opencl/math/native_log10.h>
+#include <clc/opencl/math/native_log2.h>
+#include <clc/opencl/math/native_powr.h>
+#include <clc/opencl/math/native_recip.h>
+#include <clc/opencl/math/native_rsqrt.h>
+#include <clc/opencl/math/native_sin.h>
+#include <clc/opencl/math/native_sqrt.h>
+#include <clc/opencl/math/native_tan.h>
 #include <clc/opencl/math/nextafter.h>
 #include <clc/opencl/math/pow.h>
 #include <clc/opencl/math/pown.h>
@@ -116,6 +130,7 @@
 #include <clc/opencl/math/rint.h>
 #include <clc/opencl/math/rootn.h>
 #include <clc/opencl/math/round.h>
+#include <clc/opencl/math/rsqrt.h>
 #include <clc/opencl/math/sin.h>
 #include <clc/opencl/math/sincos.h>
 #include <clc/opencl/math/sinh.h>
@@ -126,21 +141,6 @@
 #include <clc/opencl/math/tanpi.h>
 #include <clc/opencl/math/tgamma.h>
 #include <clc/opencl/math/trunc.h>
-#include <clc/opencl/math/native_cos.h>
-#include <clc/opencl/math/native_divide.h>
-#include <clc/opencl/math/native_exp.h>
-#include <clc/opencl/math/native_exp10.h>
-#include <clc/opencl/math/native_exp2.h>
-#include <clc/opencl/math/native_log.h>
-#include <clc/opencl/math/native_log10.h>
-#include <clc/opencl/math/native_log2.h>
-#include <clc/opencl/math/native_powr.h>
-#include <clc/opencl/math/native_recip.h>
-#include <clc/opencl/math/native_sin.h>
-#include <clc/opencl/math/native_sqrt.h>
-#include <clc/opencl/math/native_rsqrt.h>
-#include <clc/opencl/math/native_tan.h>
-#include <clc/opencl/math/rsqrt.h>
 
 /* 6.11.2.1 Floating-point macros */
 #include <clc/float/definitions.h>
@@ -175,8 +175,8 @@
 
 /* 6.11.4 Common Functions */
 #include <clc/opencl/common/degrees.h>
-#include <clc/opencl/common/radians.h>
 #include <clc/opencl/common/mix.h>
+#include <clc/opencl/common/radians.h>
 #include <clc/opencl/common/sign.h>
 #include <clc/opencl/common/smoothstep.h>
 #include <clc/opencl/common/step.h>
@@ -212,8 +212,8 @@
 #include <clc/opencl/relational/signbit.h>
 
 /* 6.11.8 Synchronization Functions */
-#include <clc/opencl/synchronization/cl_mem_fence_flags.h>
 #include <clc/opencl/synchronization/barrier.h>
+#include <clc/opencl/synchronization/cl_mem_fence_flags.h>
 
 /* 6.11.9 Explicit Memory Fence Functions */
 #include <clc/opencl/explicit_fence/explicit_memory_fence.h>
@@ -259,8 +259,8 @@
 #include <clc/opencl/misc/shuffle2.h>
 
 /* 6.11.13 Image Read and Write Functions */
-#include <clc/opencl/image/image_defines.h>
 #include <clc/opencl/image/image.h>
+#include <clc/opencl/image/image_defines.h>
 
 #pragma OPENCL EXTENSION all : disable
 
diff --git a/libclc/opencl/include/clc/opencl/common/mix.inc b/libclc/opencl/include/clc/opencl/common/mix.inc
index 87167fcd19ec3..2b8350f5baae1 100644
--- a/libclc/opencl/include/clc/opencl/common/mix.inc
+++ b/libclc/opencl/include/clc/opencl/common/mix.inc
@@ -6,8 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mix(__CLC_GENTYPE a, __CLC_GENTYPE b, __CLC_GENTYPE c);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mix(__CLC_GENTYPE a, __CLC_GENTYPE b,
+                                          __CLC_GENTYPE c);
 
 #ifndef __CLC_SCALAR
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mix(__CLC_GENTYPE a, __CLC_GENTYPE b, __CLC_SCALAR_GENTYPE c);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mix(__CLC_GENTYPE a, __CLC_GENTYPE b,
+                                          __CLC_SCALAR_GENTYPE c);
 #endif
diff --git a/libclc/opencl/include/clc/opencl/common/smoothstep.inc b/libclc/opencl/include/clc/opencl/common/smoothstep.inc
index 2efaa2494c85d..4547483364ba2 100644
--- a/libclc/opencl/include/clc/opencl/common/smoothstep.inc
+++ b/libclc/opencl/include/clc/opencl/common/smoothstep.inc
@@ -6,9 +6,13 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE smoothstep(__CLC_GENTYPE edge0, __CLC_GENTYPE edge1, __CLC_GENTYPE x);
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE smoothstep(float edge0, float edge1, __CLC_GENTYPE x);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE smoothstep(__CLC_GENTYPE edge0,
+                                                 __CLC_GENTYPE edge1,
+                                                 __CLC_GENTYPE x);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE smoothstep(float edge0, float edge1,
+                                                 __CLC_GENTYPE x);
 
 #ifdef cl_khr_fp64
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE smoothstep(double edge0, double edge1, __CLC_GENTYPE x);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE smoothstep(double edge0, double edge1,
+                                                 __CLC_GENTYPE x);
 #endif
diff --git a/libclc/opencl/include/clc/opencl/image/image.h b/libclc/opencl/include/clc/opencl/image/image.h
index 555ec3904c1f8..6435f3430e2fe 100644
--- a/libclc/opencl/include/clc/opencl/image/image.h
+++ b/libclc/opencl/include/clc/opencl/image/image.h
@@ -8,41 +8,41 @@
 
 #if defined(__opencl_c_images)
 
-_CLC_OVERLOAD _CLC_DECL int get_image_width (image2d_t image);
-_CLC_OVERLOAD _CLC_DECL int get_image_width (image3d_t image);
-
-_CLC_OVERLOAD _CLC_DECL int get_image_height (image2d_t image);
-_CLC_OVERLOAD _CLC_DECL int get_image_height (image3d_t image);
-
-_CLC_OVERLOAD _CLC_DECL int get_image_depth (image3d_t image);
-
-_CLC_OVERLOAD _CLC_DECL int get_image_channel_data_type (image2d_t image);
-_CLC_OVERLOAD _CLC_DECL int get_image_channel_data_type (image3d_t image);
-
-_CLC_OVERLOAD _CLC_DECL int get_image_channel_order (image2d_t image);
-_CLC_OVERLOAD _CLC_DECL int get_image_channel_order (image3d_t image);
-
-_CLC_OVERLOAD _CLC_DECL int2 get_image_dim (image2d_t image);
-_CLC_OVERLOAD _CLC_DECL int4 get_image_dim (image3d_t image);
-
-_CLC_OVERLOAD _CLC_DECL void
-write_imagef(image2d_t image, int2 coord, float4 color);
-_CLC_OVERLOAD _CLC_DECL void
-write_imagei(image2d_t image, int2 coord, int4 color);
-_CLC_OVERLOAD _CLC_DECL void
-write_imageui(image2d_t image, int2 coord, uint4 color);
-
-_CLC_OVERLOAD _CLC_DECL float4
-read_imagef(image2d_t image, sampler_t sampler, int2 coord);
-_CLC_OVERLOAD _CLC_DECL float4
-read_imagef(image2d_t image, sampler_t sampler, float2 coord);
-_CLC_OVERLOAD _CLC_DECL int4
-read_imagei(image2d_t image, sampler_t sampler, int2 coord);
-_CLC_OVERLOAD _CLC_DECL int4
-read_imagei(image2d_t image, sampler_t sampler, float2 coord);
-_CLC_OVERLOAD _CLC_DECL uint4
-read_imageui(image2d_t image, sampler_t sampler, int2 coord);
-_CLC_OVERLOAD _CLC_DECL uint4
-read_imageui(image2d_t image, sampler_t sampler, float2 coord);
+_CLC_OVERLOAD _CLC_DECL int get_image_width(image2d_t image);
+_CLC_OVERLOAD _CLC_DECL int get_image_width(image3d_t image);
+
+_CLC_OVERLOAD _CLC_DECL int get_image_height(image2d_t image);
+_CLC_OVERLOAD _CLC_DECL int get_image_height(image3d_t image);
+
+_CLC_OVERLOAD _CLC_DECL int get_image_depth(image3d_t image);
+
+_CLC_OVERLOAD _CLC_DECL int get_image_channel_data_type(image2d_t image);
+_CLC_OVERLOAD _CLC_DECL int get_image_channel_data_type(image3d_t image);
+
+_CLC_OVERLOAD _CLC_DECL int get_image_channel_order(image2d_t image);
+_CLC_OVERLOAD _CLC_DECL int get_image_channel_order(image3d_t image);
+
+_CLC_OVERLOAD _CLC_DECL int2 get_image_dim(image2d_t image);
+_CLC_OVERLOAD _CLC_DECL int4 get_image_dim(image3d_t image);
+
+_CLC_OVERLOAD _CLC_DECL void write_imagef(image2d_t image, int2 coord,
+                                          float4 color);
+_CLC_OVERLOAD _CLC_DECL void write_imagei(image2d_t image, int2 coord,
+                                          int4 color);
+_CLC_OVERLOAD _CLC_DECL void write_imageui(image2d_t image, int2 coord,
+                                           uint4 color);
+
+_CLC_OVERLOAD _CLC_DECL float4 read_imagef(image2d_t image, sampler_t sampler,
+                                           int2 coord);
+_CLC_OVERLOAD _CLC_DECL float4 read_imagef(image2d_t image, sampler_t sampler,
+                                           float2 coord);
+_CLC_OVERLOAD _CLC_DECL int4 read_imagei(image2d_t image, sampler_t sampler,
+                                         int2 coord);
+_CLC_OVERLOAD _CLC_DECL int4 read_imagei(image2d_t image, sampler_t sampler,
+                                         float2 coord);
+_CLC_OVERLOAD _CLC_DECL uint4 read_imageui(image2d_t image, sampler_t sampler,
+                                           int2 coord);
+_CLC_OVERLOAD _CLC_DECL uint4 read_imageui(image2d_t image, sampler_t sampler,
+                                           float2 coord);
 
 #endif
diff --git a/libclc/opencl/include/clc/opencl/image/image_defines.h b/libclc/opencl/include/clc/opencl/image/image_defines.h
index 12fa43be82dab..f3589fdc4a89a 100644
--- a/libclc/opencl/include/clc/opencl/image/image_defines.h
+++ b/libclc/opencl/include/clc/opencl/image/image_defines.h
@@ -7,51 +7,51 @@
 //===----------------------------------------------------------------------===//
 
 /* get_image_channel_data_type flags */
-#define CLK_SNORM_INT8               0x10D0
-#define CLK_SNORM_INT16              0x10D1
-#define CLK_UNORM_INT8               0x10D2
-#define CLK_UNORM_INT16              0x10D3
-#define CLK_UNORM_SHORT_565          0x10D4
-#define CLK_UNORM_SHORT_555          0x10D5
-#define CLK_UNORM_SHORT_101010       0x10D6
-#define CLK_SIGNED_INT8              0x10D7
-#define CLK_SIGNED_INT16             0x10D8
-#define CLK_SIGNED_INT32             0x10D9
-#define CLK_UNSIGNED_INT8            0x10DA
-#define CLK_UNSIGNED_INT16           0x10DB
-#define CLK_UNSIGNED_INT32           0x10DC
-#define CLK_HALF_FLOAT               0x10DD
-#define CLK_FLOAT                    0x10DE
+#define CLK_SNORM_INT8 0x10D0
+#define CLK_SNORM_INT16 0x10D1
+#define CLK_UNORM_INT8 0x10D2
+#define CLK_UNORM_INT16 0x10D3
+#define CLK_UNORM_SHORT_565 0x10D4
+#define CLK_UNORM_SHORT_555 0x10D5
+#define CLK_UNORM_SHORT_101010 0x10D6
+#define CLK_SIGNED_INT8 0x10D7
+#define CLK_SIGNED_INT16 0x10D8
+#define CLK_SIGNED_INT32 0x10D9
+#define CLK_UNSIGNED_INT8 0x10DA
+#define CLK_UNSIGNED_INT16 0x10DB
+#define CLK_UNSIGNED_INT32 0x10DC
+#define CLK_HALF_FLOAT 0x10DD
+#define CLK_FLOAT 0x10DE
 
 /* get_image_channel_order flags */
-#define CLK_R                        0x10B0
-#define CLK_A                        0x10B1
-#define CLK_RG                       0x10B2
-#define CLK_RA                       0x10B3
-#define CLK_RGB                      0x10B4
-#define CLK_RGBA                     0x10B5
-#define CLK_BGRA                     0x10B6
-#define CLK_ARGB                     0x10B7
-#define CLK_INTENSITY                0x10B8
-#define CLK_LUMINANCE                0x10B9
-#define CLK_Rx                       0x10BA
-#define CLK_RGx                      0x10BB
-#define CLK_RGBx                     0x10BC
+#define CLK_R 0x10B0
+#define CLK_A 0x10B1
+#define CLK_RG 0x10B2
+#define CLK_RA 0x10B3
+#define CLK_RGB 0x10B4
+#define CLK_RGBA 0x10B5
+#define CLK_BGRA 0x10B6
+#define CLK_ARGB 0x10B7
+#define CLK_INTENSITY 0x10B8
+#define CLK_LUMINANCE 0x10B9
+#define CLK_Rx 0x10BA
+#define CLK_RGx 0x10BB
+#define CLK_RGBx 0x10BC
 
 /* sampler normalized coords */
-#define CLK_NORMALIZED_COORDS_FALSE  0x0000
-#define CLK_NORMALIZED_COORDS_TRUE   0x0001
+#define CLK_NORMALIZED_COORDS_FALSE 0x0000
+#define CLK_NORMALIZED_COORDS_TRUE 0x0001
 #define __CLC_NORMALIZED_COORDS_MASK 0x0001
 
 /* sampler addressing mode */
-#define CLK_ADDRESS_NONE             0x0000
-#define CLK_ADDRESS_CLAMP_TO_EDGE    0x0002
-#define CLK_ADDRESS_CLAMP            0x0004
-#define CLK_ADDRESS_REPEAT           0x0006
-#define CLK_ADDRESS_MIRRORED_REPEAT  0x0008
-#define __CLC_ADDRESS_MASK           0x000E
+#define CLK_ADDRESS_NONE 0x0000
+#define CLK_ADDRESS_CLAMP_TO_EDGE 0x0002
+#define CLK_ADDRESS_CLAMP 0x0004
+#define CLK_ADDRESS_REPEAT 0x0006
+#define CLK_ADDRESS_MIRRORED_REPEAT 0x0008
+#define __CLC_ADDRESS_MASK 0x000E
 
 /* sampler filter mode */
-#define CLK_FILTER_NEAREST           0x0000
-#define CLK_FILTER_LINEAR            0x0010
-#define __CLC_FILTER_MASK            0x0010
+#define CLK_FILTER_NEAREST 0x0000
+#define CLK_FILTER_LINEAR 0x0010
+#define __CLC_FILTER_MASK 0x0010
diff --git a/libclc/opencl/include/clc/opencl/integer/abs_diff.inc b/libclc/opencl/include/clc/opencl/integer/abs_diff.inc
index e99f9d686bbed..41873854021eb 100644
--- a/libclc/opencl/include/clc/opencl/integer/abs_diff.inc
+++ b/libclc/opencl/include/clc/opencl/integer/abs_diff.inc
@@ -6,4 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DECL __CLC_U_GENTYPE abs_diff(__CLC_GENTYPE x, __CLC_GENTYPE y);
+_CLC_OVERLOAD _CLC_DECL __CLC_U_GENTYPE abs_diff(__CLC_GENTYPE x,
+                                                 __CLC_GENTYPE y);
diff --git a/libclc/opencl/include/clc/opencl/math/fmax.h b/libclc/opencl/include/clc/opencl/math/fmax.h
index 6c943370e28da..2144bb334f1ae 100644
--- a/libclc/opencl/include/clc/opencl/math/fmax.h
+++ b/libclc/opencl/include/clc/opencl/math/fmax.h
@@ -12,4 +12,3 @@
 #include <clc/math/gentype.inc>
 
 #undef __CLC_FUNCTION
-
diff --git a/libclc/opencl/include/clc/opencl/math/fmin.h b/libclc/opencl/include/clc/opencl/math/fmin.h
index 45d83909cef5c..5a2af3725bf2b 100644
--- a/libclc/opencl/include/clc/opencl/math/fmin.h
+++ b/libclc/opencl/include/clc/opencl/math/fmin.h
@@ -12,4 +12,3 @@
 #include <clc/math/gentype.inc>
 
 #undef __CLC_FUNCTION
-
diff --git a/libclc/opencl/include/clc/opencl/math/frexp.inc b/libclc/opencl/include/clc/opencl/math/frexp.inc
index 63fe3cb90403b..620db60636107 100644
--- a/libclc/opencl/include/clc/opencl/math/frexp.inc
+++ b/libclc/opencl/include/clc/opencl/math/frexp.inc
@@ -6,6 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x, global __CLC_INTN *iptr);
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x, local __CLC_INTN *iptr);
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x, private __CLC_INTN *iptr);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x,
+                                            global __CLC_INTN *iptr);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x,
+                                            local __CLC_INTN *iptr);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x,
+                                            private __CLC_INTN *iptr);
diff --git a/libclc/opencl/include/clc/opencl/misc/shuffle2.h b/libclc/opencl/include/clc/opencl/misc/shuffle2.h
index 93845f89911bd..fa33f6058d583 100644
--- a/libclc/opencl/include/clc/opencl/misc/shuffle2.h
+++ b/libclc/opencl/include/clc/opencl/misc/shuffle2.h
@@ -6,24 +6,24 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define _CLC_SHUFFLE2_DECL(TYPE, MASKTYPE, RETTYPE) \
+#define _CLC_SHUFFLE2_DECL(TYPE, MASKTYPE, RETTYPE)                            \
   _CLC_OVERLOAD _CLC_DECL RETTYPE shuffle2(TYPE x, TYPE y, MASKTYPE mask);
 
-//Return type is same base type as the input type, with the same vector size as the mask.
-//Elements in the mask must be the same size (number of bits) as the input value.
-//E.g. char8 ret = shuffle2(char2 x, char2 y, uchar8 mask);
+// Return type is same base type as the input type, with the same vector size as
+// the mask. Elements in the mask must be the same size (number of bits) as the
+// input value. E.g. char8 ret = shuffle2(char2 x, char2 y, uchar8 mask);
 
-#define _CLC_VECTOR_SHUFFLE2_MASKSIZE(INBASE, INTYPE, MASKTYPE) \
-  _CLC_SHUFFLE2_DECL(INTYPE, MASKTYPE##2, INBASE##2) \
-  _CLC_SHUFFLE2_DECL(INTYPE, MASKTYPE##4, INBASE##4) \
-  _CLC_SHUFFLE2_DECL(INTYPE, MASKTYPE##8, INBASE##8) \
-  _CLC_SHUFFLE2_DECL(INTYPE, MASKTYPE##16, INBASE##16) \
+#define _CLC_VECTOR_SHUFFLE2_MASKSIZE(INBASE, INTYPE, MASKTYPE)                \
+  _CLC_SHUFFLE2_DECL(INTYPE, MASKTYPE##2, INBASE##2)                           \
+  _CLC_SHUFFLE2_DECL(INTYPE, MASKTYPE##4, INBASE##4)                           \
+  _CLC_SHUFFLE2_DECL(INTYPE, MASKTYPE##8, INBASE##8)                           \
+  _CLC_SHUFFLE2_DECL(INTYPE, MASKTYPE##16, INBASE##16)
 
-#define _CLC_VECTOR_SHUFFLE2_INSIZE(TYPE, MASKTYPE) \
-  _CLC_VECTOR_SHUFFLE2_MASKSIZE(TYPE, TYPE##2, MASKTYPE) \
-  _CLC_VECTOR_SHUFFLE2_MASKSIZE(TYPE, TYPE##4, MASKTYPE) \
-  _CLC_VECTOR_SHUFFLE2_MASKSIZE(TYPE, TYPE##8, MASKTYPE) \
-  _CLC_VECTOR_SHUFFLE2_MASKSIZE(TYPE, TYPE##16, MASKTYPE) \
+#define _CLC_VECTOR_SHUFFLE2_INSIZE(TYPE, MASKTYPE)                            \
+  _CLC_VECTOR_SHUFFLE2_MASKSIZE(TYPE, TYPE##2, MASKTYPE)                       \
+  _CLC_VECTOR_SHUFFLE2_MASKSIZE(TYPE, TYPE##4, MASKTYPE)                       \
+  _CLC_VECTOR_SHUFFLE2_MASKSIZE(TYPE, TYPE##8, MASKTYPE)                       \
+  _CLC_VECTOR_SHUFFLE2_MASKSIZE(TYPE, TYPE##16, MASKTYPE)
 
 _CLC_VECTOR_SHUFFLE2_INSIZE(char, uchar)
 _CLC_VECTOR_SHUFFLE2_INSIZE(short, ushort)
diff --git a/libclc/opencl/include/clc/opencl/relational/all.h b/libclc/opencl/include/clc/opencl/relational/all.h
index a52afe813f5a1..31c8e895f6661 100644
--- a/libclc/opencl/include/clc/opencl/relational/all.h
+++ b/libclc/opencl/include/clc/opencl/relational/all.h
@@ -6,15 +6,14 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define _CLC_ALL_DECL(TYPE) \
-  _CLC_OVERLOAD _CLC_DECL int all(TYPE v);
+#define _CLC_ALL_DECL(TYPE) _CLC_OVERLOAD _CLC_DECL int all(TYPE v);
 
-#define _CLC_VECTOR_ALL_DECL(TYPE) \
-  _CLC_ALL_DECL(TYPE)     \
-  _CLC_ALL_DECL(TYPE##2)  \
-  _CLC_ALL_DECL(TYPE##3)  \
-  _CLC_ALL_DECL(TYPE##4)  \
-  _CLC_ALL_DECL(TYPE##8)  \
+#define _CLC_VECTOR_ALL_DECL(TYPE)                                             \
+  _CLC_ALL_DECL(TYPE)                                                          \
+  _CLC_ALL_DECL(TYPE##2)                                                       \
+  _CLC_ALL_DECL(TYPE##3)                                                       \
+  _CLC_ALL_DECL(TYPE##4)                                                       \
+  _CLC_ALL_DECL(TYPE##8)                                                       \
   _CLC_ALL_DECL(TYPE##16)
 
 _CLC_VECTOR_ALL_DECL(char)
diff --git a/libclc/opencl/include/clc/opencl/relational/any.h b/libclc/opencl/include/clc/opencl/relational/any.h
index 4839135de06fb..9c227e8f1600e 100644
--- a/libclc/opencl/include/clc/opencl/relational/any.h
+++ b/libclc/opencl/include/clc/opencl/relational/any.h
@@ -6,15 +6,14 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define _CLC_ANY_DECL(TYPE) \
-  _CLC_OVERLOAD _CLC_DECL int any(TYPE v);
+#define _CLC_ANY_DECL(TYPE) _CLC_OVERLOAD _CLC_DECL int any(TYPE v);
 
-#define _CLC_VECTOR_ANY_DECL(TYPE) \
-  _CLC_ANY_DECL(TYPE)     \
-  _CLC_ANY_DECL(TYPE##2)  \
-  _CLC_ANY_DECL(TYPE##3)  \
-  _CLC_ANY_DECL(TYPE##4)  \
-  _CLC_ANY_DECL(TYPE##8)  \
+#define _CLC_VECTOR_ANY_DECL(TYPE)                                             \
+  _CLC_ANY_DECL(TYPE)                                                          \
+  _CLC_ANY_DECL(TYPE##2)                                                       \
+  _CLC_ANY_DECL(TYPE##3)                                                       \
+  _CLC_ANY_DECL(TYPE##4)                                                       \
+  _CLC_ANY_DECL(TYPE##8)                                                       \
   _CLC_ANY_DECL(TYPE##16)
 
 _CLC_VECTOR_ANY_DECL(char)
diff --git a/libclc/opencl/include/clc/opencl/relational/bitselect.inc b/libclc/opencl/include/clc/opencl/relational/bitselect.inc
index d7708da2a9a44..d821bb86a1409 100644
--- a/libclc/opencl/include/clc/opencl/relational/bitselect.inc
+++ b/libclc/opencl/include/clc/opencl/relational/bitselect.inc
@@ -6,4 +6,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE bitselect(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_GENTYPE z);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE bitselect(__CLC_GENTYPE x,
+                                                __CLC_GENTYPE y,
+                                                __CLC_GENTYPE z);
diff --git a/libclc/opencl/include/clc/opencl/relational/isequal.h b/libclc/opencl/include/clc/opencl/relational/isequal.h
index 29e5cf9829fab..090b9928ede25 100644
--- a/libclc/opencl/include/clc/opencl/relational/isequal.h
+++ b/libclc/opencl/include/clc/opencl/relational/isequal.h
@@ -6,14 +6,14 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define _CLC_ISEQUAL_DECL(TYPE, RETTYPE) \
+#define _CLC_ISEQUAL_DECL(TYPE, RETTYPE)                                       \
   _CLC_OVERLOAD _CLC_DECL RETTYPE isequal(TYPE x, TYPE y);
 
-#define _CLC_VECTOR_ISEQUAL_DECL(TYPE, RETTYPE) \
-  _CLC_ISEQUAL_DECL(TYPE##2, RETTYPE##2)  \
-  _CLC_ISEQUAL_DECL(TYPE##3, RETTYPE##3)  \
-  _CLC_ISEQUAL_DECL(TYPE##4, RETTYPE##4)  \
-  _CLC_ISEQUAL_DECL(TYPE##8, RETTYPE##8)  \
+#define _CLC_VECTOR_ISEQUAL_DECL(TYPE, RETTYPE)                                \
+  _CLC_ISEQUAL_DECL(TYPE##2, RETTYPE##2)                                       \
+  _CLC_ISEQUAL_DECL(TYPE##3, RETTYPE##3)                                       \
+  _CLC_ISEQUAL_DECL(TYPE##4, RETTYPE##4)                                       \
+  _CLC_ISEQUAL_DECL(TYPE##8, RETTYPE##8)                                       \
   _CLC_ISEQUAL_DECL(TYPE##16, RETTYPE##16)
 
 _CLC_ISEQUAL_DECL(float, int)
diff --git a/libclc/opencl/include/clc/opencl/relational/isinf.h b/libclc/opencl/include/clc/opencl/relational/isinf.h
index 4a026b4b0365c..da38b01e364b5 100644
--- a/libclc/opencl/include/clc/opencl/relational/isinf.h
+++ b/libclc/opencl/include/clc/opencl/relational/isinf.h
@@ -6,14 +6,14 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define _CLC_ISINF_DECL(RET_TYPE, ARG_TYPE) \
+#define _CLC_ISINF_DECL(RET_TYPE, ARG_TYPE)                                    \
   _CLC_OVERLOAD _CLC_DECL RET_TYPE isinf(ARG_TYPE);
 
-#define _CLC_VECTOR_ISINF_DECL(RET_TYPE, ARG_TYPE) \
-  _CLC_ISINF_DECL(RET_TYPE##2, ARG_TYPE##2) \
-  _CLC_ISINF_DECL(RET_TYPE##3, ARG_TYPE##3) \
-  _CLC_ISINF_DECL(RET_TYPE##4, ARG_TYPE##4) \
-  _CLC_ISINF_DECL(RET_TYPE##8, ARG_TYPE##8) \
+#define _CLC_VECTOR_ISINF_DECL(RET_TYPE, ARG_TYPE)                             \
+  _CLC_ISINF_DECL(RET_TYPE##2, ARG_TYPE##2)                                    \
+  _CLC_ISINF_DECL(RET_TYPE##3, ARG_TYPE##3)                                    \
+  _CLC_ISINF_DECL(RET_TYPE##4, ARG_TYPE##4)                                    \
+  _CLC_ISINF_DECL(RET_TYPE##8, ARG_TYPE##8)                                    \
   _CLC_ISINF_DECL(RET_TYPE##16, ARG_TYPE##16)
 
 _CLC_ISINF_DECL(int, float)
diff --git a/libclc/opencl/include/clc/opencl/relational/isnan.h b/libclc/opencl/include/clc/opencl/relational/isnan.h
index e8033d60f3c1a..e712d6a5d93a9 100644
--- a/libclc/opencl/include/clc/opencl/relational/isnan.h
+++ b/libclc/opencl/include/clc/opencl/relational/isnan.h
@@ -6,14 +6,14 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define _CLC_ISNAN_DECL(RET_TYPE, ARG_TYPE) \
+#define _CLC_ISNAN_DECL(RET_TYPE, ARG_TYPE)                                    \
   _CLC_OVERLOAD _CLC_DECL RET_TYPE isnan(ARG_TYPE);
 
-#define _CLC_VECTOR_ISNAN_DECL(RET_TYPE, ARG_TYPE) \
-  _CLC_ISNAN_DECL(RET_TYPE##2, ARG_TYPE##2) \
-  _CLC_ISNAN_DECL(RET_TYPE##3, ARG_TYPE##3) \
-  _CLC_ISNAN_DECL(RET_TYPE##4, ARG_TYPE##4) \
-  _CLC_ISNAN_DECL(RET_TYPE##8, ARG_TYPE##8) \
+#define _CLC_VECTOR_ISNAN_DECL(RET_TYPE, ARG_TYPE)                             \
+  _CLC_ISNAN_DECL(RET_TYPE##2, ARG_TYPE##2)                                    \
+  _CLC_ISNAN_DECL(RET_TYPE##3, ARG_TYPE##3)                                    \
+  _CLC_ISNAN_DECL(RET_TYPE##4, ARG_TYPE##4)                                    \
+  _CLC_ISNAN_DECL(RET_TYPE##8, ARG_TYPE##8)                                    \
   _CLC_ISNAN_DECL(RET_TYPE##16, ARG_TYPE##16)
 
 _CLC_ISNAN_DECL(int, float)
diff --git a/libclc/opencl/include/clc/opencl/shared/clamp.inc b/libclc/opencl/include/clc/opencl/shared/clamp.inc
index fdf7ac742b42b..75dec9c258e8a 100644
--- a/libclc/opencl/include/clc/opencl/shared/clamp.inc
+++ b/libclc/opencl/include/clc/opencl/shared/clamp.inc
@@ -6,8 +6,11 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE clamp(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_GENTYPE z);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE clamp(__CLC_GENTYPE x, __CLC_GENTYPE y,
+                                            __CLC_GENTYPE z);
 
 #ifndef __CLC_SCALAR
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE clamp(__CLC_GENTYPE x, __CLC_SCALAR_GENTYPE y, __CLC_SCALAR_GENTYPE z);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE clamp(__CLC_GENTYPE x,
+                                            __CLC_SCALAR_GENTYPE y,
+                                            __CLC_SCALAR_GENTYPE z);
 #endif
diff --git a/libclc/opencl/include/clc/opencl/shared/max.inc b/libclc/opencl/include/clc/opencl/shared/max.inc
index 19f3e2d174e3d..98610dfdb1018 100644
--- a/libclc/opencl/include/clc/opencl/shared/max.inc
+++ b/libclc/opencl/include/clc/opencl/shared/max.inc
@@ -9,5 +9,6 @@
 _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE max(__CLC_GENTYPE a, __CLC_GENTYPE b);
 
 #ifndef __CLC_SCALAR
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE max(__CLC_GENTYPE a, __CLC_SCALAR_GENTYPE b);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE max(__CLC_GENTYPE a,
+                                          __CLC_SCALAR_GENTYPE b);
 #endif
diff --git a/libclc/opencl/include/clc/opencl/shared/min.inc b/libclc/opencl/include/clc/opencl/shared/min.inc
index e4e46c436b368..3140b637f3953 100644
--- a/libclc/opencl/include/clc/opencl/shared/min.inc
+++ b/libclc/opencl/include/clc/opencl/shared/min.inc
@@ -9,5 +9,6 @@
 _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE min(__CLC_GENTYPE a, __CLC_GENTYPE b);
 
 #ifndef __CLC_SCALAR
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE min(__CLC_GENTYPE a, __CLC_SCALAR_GENTYPE b);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE min(__CLC_GENTYPE a,
+                                          __CLC_SCALAR_GENTYPE b);
 #endif
diff --git a/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_global_size.cl b/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_global_size.cl
index eeac17a426558..2d7fea91233aa 100644
--- a/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_global_size.cl
+++ b/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_global_size.cl
@@ -20,7 +20,8 @@
 #define __dispatch_ptr __builtin_amdgcn_dispatch_ptr
 #else
 #define __dispatch_ptr __clc_amdgcn_dispatch_ptr
-CONST_AS uchar * __clc_amdgcn_dispatch_ptr(void) __asm("llvm.amdgcn.dispatch.ptr");
+CONST_AS uchar *
+__clc_amdgcn_dispatch_ptr(void) __asm("llvm.amdgcn.dispatch.ptr");
 #endif
 
 _CLC_DEF _CLC_OVERLOAD size_t get_global_size(uint dim) {
diff --git a/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_local_size.cl b/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_local_size.cl
index 4781c400be30c..84552e2e08fd7 100644
--- a/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_local_size.cl
+++ b/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_local_size.cl
@@ -20,7 +20,8 @@
 #define __dispatch_ptr __builtin_amdgcn_dispatch_ptr
 #else
 #define __dispatch_ptr __clc_amdgcn_dispatch_ptr
-CONST_AS char * __clc_amdgcn_dispatch_ptr(void) __asm("llvm.amdgcn.dispatch.ptr");
+CONST_AS char *
+__clc_amdgcn_dispatch_ptr(void) __asm("llvm.amdgcn.dispatch.ptr");
 #endif
 
 _CLC_DEF _CLC_OVERLOAD size_t get_local_size(uint dim) {
diff --git a/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_num_groups.cl b/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_num_groups.cl
index 4fb088fb0127a..1ed16736376f6 100644
--- a/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_num_groups.cl
+++ b/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_num_groups.cl
@@ -6,7 +6,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-
 #include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_num_groups(uint dim) {
diff --git a/libclc/opencl/lib/amdgcn/mem_fence/fence.cl b/libclc/opencl/lib/amdgcn/mem_fence/fence.cl
index 5e0180dc166b3..5c5029a63cfc7 100644
--- a/libclc/opencl/lib/amdgcn/mem_fence/fence.cl
+++ b/libclc/opencl/lib/amdgcn/mem_fence/fence.cl
@@ -19,10 +19,10 @@ void __clc_amdgcn_s_waitcnt(unsigned flags);
 
 // Newer clang supports __builtin_amdgcn_s_waitcnt
 #if __clang_major__ >= 5
-#  define __waitcnt(x) __builtin_amdgcn_s_waitcnt(x)
+#define __waitcnt(x) __builtin_amdgcn_s_waitcnt(x)
 #else
-#  define __waitcnt(x) __clc_amdgcn_s_waitcnt(x)
-_CLC_DEF void __clc_amdgcn_s_waitcnt(unsigned)  __asm("llvm.amdgcn.s.waitcnt");
+#define __waitcnt(x) __clc_amdgcn_s_waitcnt(x)
+_CLC_DEF void __clc_amdgcn_s_waitcnt(unsigned) __asm("llvm.amdgcn.s.waitcnt");
 #endif
 
 _CLC_DEF _CLC_OVERLOAD void mem_fence(cl_mem_fence_flags flags) {
diff --git a/libclc/opencl/lib/clspv/math/fma.cl b/libclc/opencl/lib/clspv/math/fma.cl
index 014e311ff91a4..2722018121224 100644
--- a/libclc/opencl/lib/clspv/math/fma.cl
+++ b/libclc/opencl/lib/clspv/math/fma.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/internal/math/clc_sw_fma.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEFINE_TERNARY_BUILTIN(float, fma, __clc_sw_fma, float, float, float)
diff --git a/libclc/opencl/lib/clspv/subnormal_config.cl b/libclc/opencl/lib/clspv/subnormal_config.cl
index 50997134bcd99..77d60ab9cbbde 100644
--- a/libclc/opencl/lib/clspv/subnormal_config.cl
+++ b/libclc/opencl/lib/clspv/subnormal_config.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_subnormal_config.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF bool __clc_fp16_subnormals_supported() { return false; }
 
diff --git a/libclc/opencl/lib/generic/async/async_work_group_copy.inc b/libclc/opencl/lib/generic/async/async_work_group_copy.inc
index d21cc8e238bf3..f238ae6684424 100644
--- a/libclc/opencl/lib/generic/async/async_work_group_copy.inc
+++ b/libclc/opencl/lib/generic/async/async_work_group_copy.inc
@@ -6,20 +6,16 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DEF event_t async_work_group_copy(
-    local __CLC_GENTYPE *dst,
-    const global __CLC_GENTYPE *src,
-    size_t num_gentypes,
-    event_t event) {
+_CLC_OVERLOAD _CLC_DEF event_t
+async_work_group_copy(local __CLC_GENTYPE *dst, const global __CLC_GENTYPE *src,
+                      size_t num_gentypes, event_t event) {
 
   return async_work_group_strided_copy(dst, src, num_gentypes, 1, event);
 }
 
-_CLC_OVERLOAD _CLC_DEF event_t async_work_group_copy(
-    global __CLC_GENTYPE *dst,
-    const local __CLC_GENTYPE *src,
-    size_t num_gentypes,
-    event_t event) {
+_CLC_OVERLOAD _CLC_DEF event_t
+async_work_group_copy(global __CLC_GENTYPE *dst, const local __CLC_GENTYPE *src,
+                      size_t num_gentypes, event_t event) {
 
   return async_work_group_strided_copy(dst, src, num_gentypes, 1, event);
 }
diff --git a/libclc/opencl/lib/generic/async/async_work_group_strided_copy.inc b/libclc/opencl/lib/generic/async/async_work_group_strided_copy.inc
index 218e7355ebb01..3a3f36a7d0426 100644
--- a/libclc/opencl/lib/generic/async/async_work_group_strided_copy.inc
+++ b/libclc/opencl/lib/generic/async/async_work_group_strided_copy.inc
@@ -6,35 +6,27 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define STRIDED_COPY(dst, src, num_gentypes, dst_stride, src_stride)       \
-  size_t size = get_local_size(0) * get_local_size(1) * get_local_size(2); \
-  size_t id = (get_local_size(1) * get_local_size(2) * get_local_id(0)) +  \
-              (get_local_size(2) * get_local_id(1)) +                      \
-              get_local_id(2);                                             \
-  size_t i;                                                                \
-                                                                           \
-  for (i = id; i < num_gentypes; i += size) {                              \
-    dst[i * dst_stride] = src[i * src_stride];                             \
+#define STRIDED_COPY(dst, src, num_gentypes, dst_stride, src_stride)           \
+  size_t size = get_local_size(0) * get_local_size(1) * get_local_size(2);     \
+  size_t id = (get_local_size(1) * get_local_size(2) * get_local_id(0)) +      \
+              (get_local_size(2) * get_local_id(1)) + get_local_id(2);         \
+  size_t i;                                                                    \
+                                                                               \
+  for (i = id; i < num_gentypes; i += size) {                                  \
+    dst[i * dst_stride] = src[i * src_stride];                                 \
   }
 
-
 _CLC_OVERLOAD _CLC_DEF event_t async_work_group_strided_copy(
-    local __CLC_GENTYPE *dst,
-    const global __CLC_GENTYPE *src,
-    size_t num_gentypes,
-    size_t src_stride,
-    event_t event) {
+    local __CLC_GENTYPE *dst, const global __CLC_GENTYPE *src,
+    size_t num_gentypes, size_t src_stride, event_t event) {
 
   STRIDED_COPY(dst, src, num_gentypes, 1, src_stride);
   return event;
 }
 
 _CLC_OVERLOAD _CLC_DEF event_t async_work_group_strided_copy(
-    global __CLC_GENTYPE *dst,
-    const local __CLC_GENTYPE *src,
-    size_t num_gentypes,
-    size_t dst_stride,
-    event_t event) {
+    global __CLC_GENTYPE *dst, const local __CLC_GENTYPE *src,
+    size_t num_gentypes, size_t dst_stride, event_t event) {
 
   STRIDED_COPY(dst, src, num_gentypes, dst_stride, 1);
   return event;
diff --git a/libclc/opencl/lib/generic/async/prefetch.inc b/libclc/opencl/lib/generic/async/prefetch.inc
index a9bca307c3d02..b952c532dc284 100644
--- a/libclc/opencl/lib/generic/async/prefetch.inc
+++ b/libclc/opencl/lib/generic/async/prefetch.inc
@@ -6,4 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DEF void prefetch(const global __CLC_GENTYPE *p, size_t num_gentypes) { }
+_CLC_OVERLOAD _CLC_DEF void prefetch(const global __CLC_GENTYPE *p,
+                                     size_t num_gentypes) {}
diff --git a/libclc/opencl/lib/generic/atomic/atomic_add.cl b/libclc/opencl/lib/generic/atomic/atomic_add.cl
index 775f7a684e52d..cb3935cc4f8a1 100644
--- a/libclc/opencl/lib/generic/atomic/atomic_add.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_add.cl
@@ -8,10 +8,10 @@
 
 #include <clc/opencl/clc.h>
 
-#define IMPL(TYPE, AS) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_add(volatile AS TYPE *p, TYPE val) { \
-  return __sync_fetch_and_add(p, val); \
-}
+#define IMPL(TYPE, AS)                                                         \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_add(volatile AS TYPE *p, TYPE val) {      \
+    return __sync_fetch_and_add(p, val);                                       \
+  }
 
 IMPL(int, global)
 IMPL(unsigned int, global)
diff --git a/libclc/opencl/lib/generic/atomic/atomic_and.cl b/libclc/opencl/lib/generic/atomic/atomic_and.cl
index eb99e551e7eea..f5b6e97246c6b 100644
--- a/libclc/opencl/lib/generic/atomic/atomic_and.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_and.cl
@@ -8,10 +8,10 @@
 
 #include <clc/opencl/clc.h>
 
-#define IMPL(TYPE, AS) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_and(volatile AS TYPE *p, TYPE val) { \
-  return __sync_fetch_and_and(p, val); \
-}
+#define IMPL(TYPE, AS)                                                         \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_and(volatile AS TYPE *p, TYPE val) {      \
+    return __sync_fetch_and_and(p, val);                                       \
+  }
 
 IMPL(int, global)
 IMPL(unsigned int, global)
diff --git a/libclc/opencl/lib/generic/atomic/atomic_cmpxchg.cl b/libclc/opencl/lib/generic/atomic/atomic_cmpxchg.cl
index 44f40024e473d..c2227ea5207df 100644
--- a/libclc/opencl/lib/generic/atomic/atomic_cmpxchg.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_cmpxchg.cl
@@ -8,10 +8,11 @@
 
 #include <clc/opencl/clc.h>
 
-#define IMPL(TYPE, AS) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_cmpxchg(volatile AS TYPE *p, TYPE cmp, TYPE val) { \
-  return __sync_val_compare_and_swap(p, cmp, val); \
-}
+#define IMPL(TYPE, AS)                                                         \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_cmpxchg(volatile AS TYPE *p, TYPE cmp,    \
+                                             TYPE val) {                       \
+    return __sync_val_compare_and_swap(p, cmp, val);                           \
+  }
 
 IMPL(int, global)
 IMPL(unsigned int, global)
diff --git a/libclc/opencl/lib/generic/atomic/atomic_dec.cl b/libclc/opencl/lib/generic/atomic/atomic_dec.cl
index 42e0ac28ecd0f..d67f6382fd07d 100644
--- a/libclc/opencl/lib/generic/atomic/atomic_dec.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_dec.cl
@@ -8,10 +8,10 @@
 
 #include <clc/opencl/clc.h>
 
-#define IMPL(TYPE, AS) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_dec(volatile AS TYPE *p) { \
-  return __sync_fetch_and_sub(p, (TYPE)1); \
-}
+#define IMPL(TYPE, AS)                                                         \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_dec(volatile AS TYPE *p) {                \
+    return __sync_fetch_and_sub(p, (TYPE)1);                                   \
+  }
 
 IMPL(int, global)
 IMPL(unsigned int, global)
diff --git a/libclc/opencl/lib/generic/atomic/atomic_inc.cl b/libclc/opencl/lib/generic/atomic/atomic_inc.cl
index d85c46a57d8e3..989c45c0e5d8a 100644
--- a/libclc/opencl/lib/generic/atomic/atomic_inc.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_inc.cl
@@ -8,10 +8,10 @@
 
 #include <clc/opencl/clc.h>
 
-#define IMPL(TYPE, AS) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_inc(volatile AS TYPE *p) { \
-  return __sync_fetch_and_add(p, (TYPE)1); \
-}
+#define IMPL(TYPE, AS)                                                         \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_inc(volatile AS TYPE *p) {                \
+    return __sync_fetch_and_add(p, (TYPE)1);                                   \
+  }
 
 IMPL(int, global)
 IMPL(unsigned int, global)
diff --git a/libclc/opencl/lib/generic/atomic/atomic_max.cl b/libclc/opencl/lib/generic/atomic/atomic_max.cl
index b29ccc569295c..dbd5aa049c5e7 100644
--- a/libclc/opencl/lib/generic/atomic/atomic_max.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_max.cl
@@ -8,10 +8,10 @@
 
 #include <clc/opencl/clc.h>
 
-#define IMPL(TYPE, AS, OP) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_max(volatile AS TYPE *p, TYPE val) { \
-  return __sync_fetch_and_##OP(p, val); \
-}
+#define IMPL(TYPE, AS, OP)                                                     \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_max(volatile AS TYPE *p, TYPE val) {      \
+    return __sync_fetch_and_##OP(p, val);                                      \
+  }
 
 IMPL(int, global, max)
 IMPL(unsigned int, global, umax)
diff --git a/libclc/opencl/lib/generic/atomic/atomic_min.cl b/libclc/opencl/lib/generic/atomic/atomic_min.cl
index a14595e453c71..d43f74c82ffc5 100644
--- a/libclc/opencl/lib/generic/atomic/atomic_min.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_min.cl
@@ -8,10 +8,10 @@
 
 #include <clc/opencl/clc.h>
 
-#define IMPL(TYPE, AS, OP) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_min(volatile AS TYPE *p, TYPE val) { \
-  return __sync_fetch_and_##OP(p, val); \
-}
+#define IMPL(TYPE, AS, OP)                                                     \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_min(volatile AS TYPE *p, TYPE val) {      \
+    return __sync_fetch_and_##OP(p, val);                                      \
+  }
 
 IMPL(int, global, min)
 IMPL(unsigned int, global, umin)
diff --git a/libclc/opencl/lib/generic/atomic/atomic_or.cl b/libclc/opencl/lib/generic/atomic/atomic_or.cl
index 3b044c97cbd0a..dac7eb66033b4 100644
--- a/libclc/opencl/lib/generic/atomic/atomic_or.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_or.cl
@@ -8,10 +8,10 @@
 
 #include <clc/opencl/clc.h>
 
-#define IMPL(TYPE, AS) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_or(volatile AS TYPE *p, TYPE val) { \
-  return __sync_fetch_and_or(p, val); \
-}
+#define IMPL(TYPE, AS)                                                         \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_or(volatile AS TYPE *p, TYPE val) {       \
+    return __sync_fetch_and_or(p, val);                                        \
+  }
 
 IMPL(int, global)
 IMPL(unsigned int, global)
diff --git a/libclc/opencl/lib/generic/atomic/atomic_sub.cl b/libclc/opencl/lib/generic/atomic/atomic_sub.cl
index 4588d9d9077a0..5ebe1f0b13694 100644
--- a/libclc/opencl/lib/generic/atomic/atomic_sub.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_sub.cl
@@ -8,10 +8,10 @@
 
 #include <clc/opencl/clc.h>
 
-#define IMPL(TYPE, AS) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_sub(volatile AS TYPE *p, TYPE val) { \
-  return __sync_fetch_and_sub(p, val); \
-}
+#define IMPL(TYPE, AS)                                                         \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_sub(volatile AS TYPE *p, TYPE val) {      \
+    return __sync_fetch_and_sub(p, val);                                       \
+  }
 
 IMPL(int, global)
 IMPL(unsigned int, global)
diff --git a/libclc/opencl/lib/generic/atomic/atomic_xchg.cl b/libclc/opencl/lib/generic/atomic/atomic_xchg.cl
index ab4db17f00974..b3f631c21aec3 100644
--- a/libclc/opencl/lib/generic/atomic/atomic_xchg.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_xchg.cl
@@ -16,10 +16,10 @@ _CLC_OVERLOAD _CLC_DEF float atomic_xchg(volatile local float *p, float val) {
   return as_float(atomic_xchg((volatile local uint *)p, as_uint(val)));
 }
 
-#define IMPL(TYPE, AS) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_xchg(volatile AS TYPE *p, TYPE val) { \
-  return __sync_swap_4(p, val); \
-}
+#define IMPL(TYPE, AS)                                                         \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_xchg(volatile AS TYPE *p, TYPE val) {     \
+    return __sync_swap_4(p, val);                                              \
+  }
 
 IMPL(int, global)
 IMPL(unsigned int, global)
diff --git a/libclc/opencl/lib/generic/atomic/atomic_xor.cl b/libclc/opencl/lib/generic/atomic/atomic_xor.cl
index 07e5b8bdefa00..864e22b774538 100644
--- a/libclc/opencl/lib/generic/atomic/atomic_xor.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_xor.cl
@@ -8,10 +8,10 @@
 
 #include <clc/opencl/clc.h>
 
-#define IMPL(TYPE, AS) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_xor(volatile AS TYPE *p, TYPE val) { \
-  return __sync_fetch_and_xor(p, val); \
-}
+#define IMPL(TYPE, AS)                                                         \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_xor(volatile AS TYPE *p, TYPE val) {      \
+    return __sync_fetch_and_xor(p, val);                                       \
+  }
 
 IMPL(int, global)
 IMPL(unsigned int, global)
diff --git a/libclc/opencl/lib/generic/common/degrees.cl b/libclc/opencl/lib/generic/common/degrees.cl
index 9d6c8ff3d3d43..8b17fe4321297 100644
--- a/libclc/opencl/lib/generic/common/degrees.cl
+++ b/libclc/opencl/lib/generic/common/degrees.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/common/clc_degrees.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEFINE_UNARY_BUILTIN(float, degrees, __clc_degrees, float)
 
diff --git a/libclc/opencl/lib/generic/common/mix.cl b/libclc/opencl/lib/generic/common/mix.cl
index b24cc27960cbf..cc95dcd3b615c 100644
--- a/libclc/opencl/lib/generic/common/mix.cl
+++ b/libclc/opencl/lib/generic/common/mix.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_mad.h>
+#include <clc/opencl/clc.h>
 
 #define __CLC_BODY <mix.inc>
 #include <clc/math/gentype.inc>
diff --git a/libclc/opencl/lib/generic/common/radians.cl b/libclc/opencl/lib/generic/common/radians.cl
index 67f7501652206..1c58c6c4da6f3 100644
--- a/libclc/opencl/lib/generic/common/radians.cl
+++ b/libclc/opencl/lib/generic/common/radians.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/common/clc_radians.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEFINE_UNARY_BUILTIN(float, radians, __clc_radians, float)
 
diff --git a/libclc/opencl/lib/generic/common/sign.cl b/libclc/opencl/lib/generic/common/sign.cl
index 38fa9270bf481..0acab050af598 100644
--- a/libclc/opencl/lib/generic/common/sign.cl
+++ b/libclc/opencl/lib/generic/common/sign.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/common/clc_sign.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION sign
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/common/smoothstep.cl b/libclc/opencl/lib/generic/common/smoothstep.cl
index 8bea015e7dc8f..30ed1451ff302 100644
--- a/libclc/opencl/lib/generic/common/smoothstep.cl
+++ b/libclc/opencl/lib/generic/common/smoothstep.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/common/clc_smoothstep.h>
+#include <clc/opencl/clc.h>
 
 #define SMOOTHSTEP_SINGLE_DEF(X_TYPE)                                          \
   _CLC_OVERLOAD _CLC_DEF X_TYPE smoothstep(X_TYPE edge0, X_TYPE edge1,         \
diff --git a/libclc/opencl/lib/generic/common/step.cl b/libclc/opencl/lib/generic/common/step.cl
index 581f83c2fc37f..99e69963c37ba 100644
--- a/libclc/opencl/lib/generic/common/step.cl
+++ b/libclc/opencl/lib/generic/common/step.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
+#include <clc/opencl/clc.h>
 
 _CLC_OVERLOAD _CLC_DEF float step(float edge, float x) {
   return x < edge ? 0.0f : 1.0f;
@@ -20,10 +20,10 @@ _CLC_V_S_V_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, step, float, float);
 #ifdef cl_khr_fp64
 #pragma OPENCL EXTENSION cl_khr_fp64 : enable
 
-#define STEP_DEF(edge_type, x_type) \
-  _CLC_OVERLOAD _CLC_DEF x_type step(edge_type edge, x_type x) { \
-    return x < edge ? 0.0 : 1.0; \
- }
+#define STEP_DEF(edge_type, x_type)                                            \
+  _CLC_OVERLOAD _CLC_DEF x_type step(edge_type edge, x_type x) {               \
+    return x < edge ? 0.0 : 1.0;                                               \
+  }
 
 STEP_DEF(double, double);
 
diff --git a/libclc/opencl/lib/generic/geometric/cross.cl b/libclc/opencl/lib/generic/geometric/cross.cl
index ce16fadacaae8..bd4f86bb15d84 100644
--- a/libclc/opencl/lib/generic/geometric/cross.cl
+++ b/libclc/opencl/lib/generic/geometric/cross.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/geometric/clc_cross.h>
+#include <clc/opencl/clc.h>
 
 _CLC_OVERLOAD _CLC_DEF float3 cross(float3 p0, float3 p1) {
   return __clc_cross(p0, p1);
diff --git a/libclc/opencl/lib/generic/geometric/distance.cl b/libclc/opencl/lib/generic/geometric/distance.cl
index dfe0ed5bd0fed..b2194abd60e97 100644
--- a/libclc/opencl/lib/generic/geometric/distance.cl
+++ b/libclc/opencl/lib/generic/geometric/distance.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/geometric/clc_distance.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION distance
 #define __CLC_BODY <clc/geometric/binary_def.inc>
diff --git a/libclc/opencl/lib/generic/geometric/dot.cl b/libclc/opencl/lib/generic/geometric/dot.cl
index 26b67c35a9cef..72d30ea53f8cf 100644
--- a/libclc/opencl/lib/generic/geometric/dot.cl
+++ b/libclc/opencl/lib/generic/geometric/dot.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/geometric/clc_dot.h>
+#include <clc/opencl/clc.h>
 
 _CLC_OVERLOAD _CLC_DEF float dot(float p0, float p1) {
   return __clc_dot(p0, p1);
diff --git a/libclc/opencl/lib/generic/geometric/fast_distance.cl b/libclc/opencl/lib/generic/geometric/fast_distance.cl
index 2f2931184a6c3..2a19418a175b9 100644
--- a/libclc/opencl/lib/generic/geometric/fast_distance.cl
+++ b/libclc/opencl/lib/generic/geometric/fast_distance.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/geometric/clc_fast_distance.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION fast_distance
diff --git a/libclc/opencl/lib/generic/geometric/fast_length.cl b/libclc/opencl/lib/generic/geometric/fast_length.cl
index 45c8e7596cf67..3af751af5425d 100644
--- a/libclc/opencl/lib/generic/geometric/fast_length.cl
+++ b/libclc/opencl/lib/generic/geometric/fast_length.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/geometric/clc_fast_length.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION fast_length
diff --git a/libclc/opencl/lib/generic/geometric/fast_normalize.cl b/libclc/opencl/lib/generic/geometric/fast_normalize.cl
index 8701170d54e76..d6d140f3c406d 100644
--- a/libclc/opencl/lib/generic/geometric/fast_normalize.cl
+++ b/libclc/opencl/lib/generic/geometric/fast_normalize.cl
@@ -8,9 +8,7 @@
 
 #include <clc/opencl/clc.h>
 
-_CLC_OVERLOAD _CLC_DEF float fast_normalize(float p) {
-  return normalize(p);
-}
+_CLC_OVERLOAD _CLC_DEF float fast_normalize(float p) { return normalize(p); }
 
 #define __CLC_BODY <fast_normalize.inc>
 #define __FLOAT_ONLY
diff --git a/libclc/opencl/lib/generic/geometric/length.cl b/libclc/opencl/lib/generic/geometric/length.cl
index cb4aa5a812f34..5645ade4c9172 100644
--- a/libclc/opencl/lib/generic/geometric/length.cl
+++ b/libclc/opencl/lib/generic/geometric/length.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/geometric/clc_length.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION length
 #define __CLC_BODY <clc/geometric/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/geometric/normalize.cl b/libclc/opencl/lib/generic/geometric/normalize.cl
index 14c43cbd64099..e1e51b306a1ba 100644
--- a/libclc/opencl/lib/generic/geometric/normalize.cl
+++ b/libclc/opencl/lib/generic/geometric/normalize.cl
@@ -8,9 +8,7 @@
 
 #include <clc/opencl/clc.h>
 
-_CLC_OVERLOAD _CLC_DEF float normalize(float p) {
-  return sign(p);
-}
+_CLC_OVERLOAD _CLC_DEF float normalize(float p) { return sign(p); }
 
 _CLC_OVERLOAD _CLC_DEF float2 normalize(float2 p) {
   if (all(p == (float2)0.0F))
@@ -76,9 +74,7 @@ _CLC_OVERLOAD _CLC_DEF float4 normalize(float4 p) {
 
 #pragma OPENCL EXTENSION cl_khr_fp64 : enable
 
-_CLC_OVERLOAD _CLC_DEF double normalize(double p) {
-  return sign(p);
-}
+_CLC_OVERLOAD _CLC_DEF double normalize(double p) { return sign(p); }
 
 _CLC_OVERLOAD _CLC_DEF double2 normalize(double2 p) {
   if (all(p == (double2)0.0))
diff --git a/libclc/opencl/lib/generic/integer/abs.cl b/libclc/opencl/lib/generic/integer/abs.cl
index ca1435c58e98e..5d354d97e71c5 100644
--- a/libclc/opencl/lib/generic/integer/abs.cl
+++ b/libclc/opencl/lib/generic/integer/abs.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/integer/clc_abs.h>
+#include <clc/opencl/clc.h>
 
 #define __CLC_BODY <abs.inc>
 #include <clc/integer/gentype.inc>
diff --git a/libclc/opencl/lib/generic/integer/abs_diff.cl b/libclc/opencl/lib/generic/integer/abs_diff.cl
index 17efdc2e9eb25..73d6631b3a4a3 100644
--- a/libclc/opencl/lib/generic/integer/abs_diff.cl
+++ b/libclc/opencl/lib/generic/integer/abs_diff.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/integer/clc_abs_diff.h>
+#include <clc/opencl/clc.h>
 
 #define __CLC_BODY <abs_diff.inc>
 #include <clc/integer/gentype.inc>
diff --git a/libclc/opencl/lib/generic/integer/abs_diff.inc b/libclc/opencl/lib/generic/integer/abs_diff.inc
index 57de34422b183..0f515202cd899 100644
--- a/libclc/opencl/lib/generic/integer/abs_diff.inc
+++ b/libclc/opencl/lib/generic/integer/abs_diff.inc
@@ -6,6 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DEF __CLC_U_GENTYPE abs_diff(__CLC_GENTYPE x, __CLC_GENTYPE y) {
+_CLC_OVERLOAD _CLC_DEF __CLC_U_GENTYPE abs_diff(__CLC_GENTYPE x,
+                                                __CLC_GENTYPE y) {
   return __clc_abs_diff(x, y);
 }
diff --git a/libclc/opencl/lib/generic/integer/add_sat.cl b/libclc/opencl/lib/generic/integer/add_sat.cl
index 1d46cc9a97c30..8fe1d32a82216 100644
--- a/libclc/opencl/lib/generic/integer/add_sat.cl
+++ b/libclc/opencl/lib/generic/integer/add_sat.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/integer/clc_add_sat.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION add_sat
 #define __CLC_BODY <clc/shared/binary_def.inc>
diff --git a/libclc/opencl/lib/generic/integer/clz.cl b/libclc/opencl/lib/generic/integer/clz.cl
index 7c4ba975a7d3d..cf12a9838c6d7 100644
--- a/libclc/opencl/lib/generic/integer/clz.cl
+++ b/libclc/opencl/lib/generic/integer/clz.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/integer/clc_clz.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION clz
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/integer/ctz.cl b/libclc/opencl/lib/generic/integer/ctz.cl
index 5bf32a76266cb..1b0470e08fd36 100644
--- a/libclc/opencl/lib/generic/integer/ctz.cl
+++ b/libclc/opencl/lib/generic/integer/ctz.cl
@@ -8,8 +8,8 @@
 
 #if __OPENCL_C_VERSION__ >= CL_VERSION_2_0
 
-#include <clc/opencl/clc.h>
 #include <clc/integer/clc_ctz.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION ctz
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/integer/hadd.cl b/libclc/opencl/lib/generic/integer/hadd.cl
index 037f5c3328d9f..100cb7bf207a5 100644
--- a/libclc/opencl/lib/generic/integer/hadd.cl
+++ b/libclc/opencl/lib/generic/integer/hadd.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/integer/clc_hadd.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION hadd
 #define __CLC_BODY <clc/shared/binary_def.inc>
diff --git a/libclc/opencl/lib/generic/integer/mad24.cl b/libclc/opencl/lib/generic/integer/mad24.cl
index 15afc98433287..d42873f1dd15e 100644
--- a/libclc/opencl/lib/generic/integer/mad24.cl
+++ b/libclc/opencl/lib/generic/integer/mad24.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/integer/clc_mad24.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION mad24
 #define __CLC_BODY <clc/shared/ternary_def.inc>
diff --git a/libclc/opencl/lib/generic/integer/mad_hi.cl b/libclc/opencl/lib/generic/integer/mad_hi.cl
index 53070937c1682..68e610d400cc1 100644
--- a/libclc/opencl/lib/generic/integer/mad_hi.cl
+++ b/libclc/opencl/lib/generic/integer/mad_hi.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/integer/clc_mad_hi.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION mad_hi
 #define __CLC_BODY <clc/shared/ternary_def.inc>
diff --git a/libclc/opencl/lib/generic/integer/mad_sat.cl b/libclc/opencl/lib/generic/integer/mad_sat.cl
index f083a90815f6c..d9daf56632b07 100644
--- a/libclc/opencl/lib/generic/integer/mad_sat.cl
+++ b/libclc/opencl/lib/generic/integer/mad_sat.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/integer/clc_mad_sat.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION mad_sat
 #define __CLC_BODY <clc/shared/ternary_def.inc>
diff --git a/libclc/opencl/lib/generic/integer/mul24.cl b/libclc/opencl/lib/generic/integer/mul24.cl
index b538ae11f5e8a..b0a9ff80f3528 100644
--- a/libclc/opencl/lib/generic/integer/mul24.cl
+++ b/libclc/opencl/lib/generic/integer/mul24.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/integer/clc_mul24.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION mul24
 #define __CLC_BODY <clc/shared/binary_def.inc>
diff --git a/libclc/opencl/lib/generic/integer/mul_hi.cl b/libclc/opencl/lib/generic/integer/mul_hi.cl
index 8fb0d11db0ec9..40cb359f5b296 100644
--- a/libclc/opencl/lib/generic/integer/mul_hi.cl
+++ b/libclc/opencl/lib/generic/integer/mul_hi.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/integer/clc_mul_hi.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION mul_hi
 #define __CLC_BODY <clc/shared/binary_def.inc>
diff --git a/libclc/opencl/lib/generic/integer/popcount.cl b/libclc/opencl/lib/generic/integer/popcount.cl
index ae54980c20b66..a349f454813ef 100644
--- a/libclc/opencl/lib/generic/integer/popcount.cl
+++ b/libclc/opencl/lib/generic/integer/popcount.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/integer/clc_popcount.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION popcount
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/integer/rhadd.cl b/libclc/opencl/lib/generic/integer/rhadd.cl
index b8dcbb6207155..539def845488d 100644
--- a/libclc/opencl/lib/generic/integer/rhadd.cl
+++ b/libclc/opencl/lib/generic/integer/rhadd.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/integer/clc_rhadd.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION rhadd
 #define __CLC_BODY <clc/shared/binary_def.inc>
diff --git a/libclc/opencl/lib/generic/integer/rotate.cl b/libclc/opencl/lib/generic/integer/rotate.cl
index 64eead06707d5..a340ccf77b2ea 100644
--- a/libclc/opencl/lib/generic/integer/rotate.cl
+++ b/libclc/opencl/lib/generic/integer/rotate.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/integer/clc_rotate.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION rotate
 #define __CLC_BODY <clc/shared/binary_def.inc>
diff --git a/libclc/opencl/lib/generic/integer/sub_sat.cl b/libclc/opencl/lib/generic/integer/sub_sat.cl
index 9df2e44ecb78d..46596724358ab 100644
--- a/libclc/opencl/lib/generic/integer/sub_sat.cl
+++ b/libclc/opencl/lib/generic/integer/sub_sat.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/integer/clc_sub_sat.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION sub_sat
 #define __CLC_BODY <clc/shared/binary_def.inc>
diff --git a/libclc/opencl/lib/generic/integer/upsample.cl b/libclc/opencl/lib/generic/integer/upsample.cl
index c148e9a8b522b..32cb3cffc9ebd 100644
--- a/libclc/opencl/lib/generic/integer/upsample.cl
+++ b/libclc/opencl/lib/generic/integer/upsample.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/integer/clc_upsample.h>
+#include <clc/opencl/clc.h>
 
 #define __CLC_UPSAMPLE_IMPL(BGENTYPE, GENTYPE, UGENTYPE)                       \
   _CLC_OVERLOAD _CLC_DEF BGENTYPE upsample(GENTYPE hi, UGENTYPE lo) {          \
diff --git a/libclc/opencl/lib/generic/math/acos.cl b/libclc/opencl/lib/generic/math/acos.cl
index 37d9a717b06c3..3d290225a2c29 100644
--- a/libclc/opencl/lib/generic/math/acos.cl
+++ b/libclc/opencl/lib/generic/math/acos.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_acos.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION acos
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/acosh.cl b/libclc/opencl/lib/generic/math/acosh.cl
index bdef0b9aafa53..fea40caa3e20c 100644
--- a/libclc/opencl/lib/generic/math/acosh.cl
+++ b/libclc/opencl/lib/generic/math/acosh.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_acosh.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION acosh
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/acospi.cl b/libclc/opencl/lib/generic/math/acospi.cl
index 138d59aee7317..6c5ba2982ed0b 100644
--- a/libclc/opencl/lib/generic/math/acospi.cl
+++ b/libclc/opencl/lib/generic/math/acospi.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_acospi.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION acospi
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/asin.cl b/libclc/opencl/lib/generic/math/asin.cl
index 3f3247000bfa7..b8d02cef7d3ac 100644
--- a/libclc/opencl/lib/generic/math/asin.cl
+++ b/libclc/opencl/lib/generic/math/asin.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_asin.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION asin
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/asinh.cl b/libclc/opencl/lib/generic/math/asinh.cl
index 48f7c273d460f..f043a33fe3177 100644
--- a/libclc/opencl/lib/generic/math/asinh.cl
+++ b/libclc/opencl/lib/generic/math/asinh.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_asinh.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION asinh
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/asinpi.cl b/libclc/opencl/lib/generic/math/asinpi.cl
index 7d80a3f5f6d99..688da90337ea9 100644
--- a/libclc/opencl/lib/generic/math/asinpi.cl
+++ b/libclc/opencl/lib/generic/math/asinpi.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_asinpi.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION asinpi
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/atan.cl b/libclc/opencl/lib/generic/math/atan.cl
index 13674753fb014..006fc9e65d45e 100644
--- a/libclc/opencl/lib/generic/math/atan.cl
+++ b/libclc/opencl/lib/generic/math/atan.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_atan.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION atan
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/atan2.cl b/libclc/opencl/lib/generic/math/atan2.cl
index 748438e4734f4..ae277e7dc9567 100644
--- a/libclc/opencl/lib/generic/math/atan2.cl
+++ b/libclc/opencl/lib/generic/math/atan2.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_atan2.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION atan2
 #define __CLC_BODY <clc/shared/binary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/atan2pi.cl b/libclc/opencl/lib/generic/math/atan2pi.cl
index 9a326aa689df2..06f0974d4325a 100644
--- a/libclc/opencl/lib/generic/math/atan2pi.cl
+++ b/libclc/opencl/lib/generic/math/atan2pi.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_atan2pi.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION atan2pi
 #define __CLC_BODY <clc/shared/binary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/atanh.cl b/libclc/opencl/lib/generic/math/atanh.cl
index 075297b58228f..ad4c54b81d21d 100644
--- a/libclc/opencl/lib/generic/math/atanh.cl
+++ b/libclc/opencl/lib/generic/math/atanh.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_atanh.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION atanh
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/atanpi.cl b/libclc/opencl/lib/generic/math/atanpi.cl
index 9451058b45b90..3eba081d1b3f9 100644
--- a/libclc/opencl/lib/generic/math/atanpi.cl
+++ b/libclc/opencl/lib/generic/math/atanpi.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_atanpi.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION atanpi
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/cbrt.cl b/libclc/opencl/lib/generic/math/cbrt.cl
index 4eadcf8a9421f..edccc1aaa187d 100644
--- a/libclc/opencl/lib/generic/math/cbrt.cl
+++ b/libclc/opencl/lib/generic/math/cbrt.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_cbrt.inc>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION cbrt
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/ceil.cl b/libclc/opencl/lib/generic/math/ceil.cl
index 52c5fd05daa04..981fa80a44430 100644
--- a/libclc/opencl/lib/generic/math/ceil.cl
+++ b/libclc/opencl/lib/generic/math/ceil.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_ceil.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION ceil
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/copysign.cl b/libclc/opencl/lib/generic/math/copysign.cl
index eb6b1100d2b54..9a34aa3ea94f8 100644
--- a/libclc/opencl/lib/generic/math/copysign.cl
+++ b/libclc/opencl/lib/generic/math/copysign.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_copysign.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION copysign
 #define __CLC_BODY <clc/shared/binary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/cos.cl b/libclc/opencl/lib/generic/math/cos.cl
index ba1e541ed0a95..01f419ebc2878 100644
--- a/libclc/opencl/lib/generic/math/cos.cl
+++ b/libclc/opencl/lib/generic/math/cos.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_cos.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION cos
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/cosh.cl b/libclc/opencl/lib/generic/math/cosh.cl
index 2945b992482bb..c2ee2375ce5a8 100644
--- a/libclc/opencl/lib/generic/math/cosh.cl
+++ b/libclc/opencl/lib/generic/math/cosh.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_cosh.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION cosh
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/cospi.cl b/libclc/opencl/lib/generic/math/cospi.cl
index 3737716d4960c..05de33f74373c 100644
--- a/libclc/opencl/lib/generic/math/cospi.cl
+++ b/libclc/opencl/lib/generic/math/cospi.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_cospi.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION cospi
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/erf.cl b/libclc/opencl/lib/generic/math/erf.cl
index f0ef39fbdd4fd..ba60e4c47355f 100644
--- a/libclc/opencl/lib/generic/math/erf.cl
+++ b/libclc/opencl/lib/generic/math/erf.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_erf.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION erf
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/erfc.cl b/libclc/opencl/lib/generic/math/erfc.cl
index 318c0ca3c3937..4624a04525668 100644
--- a/libclc/opencl/lib/generic/math/erfc.cl
+++ b/libclc/opencl/lib/generic/math/erfc.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_erfc.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION erfc
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/exp.cl b/libclc/opencl/lib/generic/math/exp.cl
index efbed2298e429..8b20e26716a3a 100644
--- a/libclc/opencl/lib/generic/math/exp.cl
+++ b/libclc/opencl/lib/generic/math/exp.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_exp.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION exp
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/exp10.cl b/libclc/opencl/lib/generic/math/exp10.cl
index cf0e1a58206bd..d5bcf1960d7d9 100644
--- a/libclc/opencl/lib/generic/math/exp10.cl
+++ b/libclc/opencl/lib/generic/math/exp10.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_exp10.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION exp10
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/exp2.cl b/libclc/opencl/lib/generic/math/exp2.cl
index 3618f56e32558..130dbbd77be8a 100644
--- a/libclc/opencl/lib/generic/math/exp2.cl
+++ b/libclc/opencl/lib/generic/math/exp2.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_exp2.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION exp2
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/expm1.cl b/libclc/opencl/lib/generic/math/expm1.cl
index 26aa2932a4542..26c3eac9e678b 100644
--- a/libclc/opencl/lib/generic/math/expm1.cl
+++ b/libclc/opencl/lib/generic/math/expm1.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_expm1.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION expm1
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/fabs.cl b/libclc/opencl/lib/generic/math/fabs.cl
index 461b9a56d31c4..4f9cf117a85f2 100644
--- a/libclc/opencl/lib/generic/math/fabs.cl
+++ b/libclc/opencl/lib/generic/math/fabs.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_fabs.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION fabs
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/fdim.cl b/libclc/opencl/lib/generic/math/fdim.cl
index f901c6010a47b..6b9a46c1bbe1a 100644
--- a/libclc/opencl/lib/generic/math/fdim.cl
+++ b/libclc/opencl/lib/generic/math/fdim.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_fdim.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION fdim
 #define __CLC_BODY <clc/shared/binary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/floor.cl b/libclc/opencl/lib/generic/math/floor.cl
index 6cad3b3335e9a..9d5f5691a7059 100644
--- a/libclc/opencl/lib/generic/math/floor.cl
+++ b/libclc/opencl/lib/generic/math/floor.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_floor.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION floor
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/fma.cl b/libclc/opencl/lib/generic/math/fma.cl
index 0c43d2b028dae..ee3395bb2c648 100644
--- a/libclc/opencl/lib/generic/math/fma.cl
+++ b/libclc/opencl/lib/generic/math/fma.cl
@@ -6,10 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_fma.h>
 #include <clc/math/math.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEFINE_TERNARY_BUILTIN(float, fma, __clc_fma, float, float, float)
 
diff --git a/libclc/opencl/lib/generic/math/fmax.cl b/libclc/opencl/lib/generic/math/fmax.cl
index ff06226b33617..6bc22823757a6 100644
--- a/libclc/opencl/lib/generic/math/fmax.cl
+++ b/libclc/opencl/lib/generic/math/fmax.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_fmax.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION fmax
 #define __CLC_BODY <clc/shared/binary_def_with_scalar_second_arg.inc>
diff --git a/libclc/opencl/lib/generic/math/fmin.cl b/libclc/opencl/lib/generic/math/fmin.cl
index 9a6f0f79f4f2c..2aea160b975e4 100644
--- a/libclc/opencl/lib/generic/math/fmin.cl
+++ b/libclc/opencl/lib/generic/math/fmin.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_fmin.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION fmin
 #define __CLC_BODY <clc/shared/binary_def_with_scalar_second_arg.inc>
diff --git a/libclc/opencl/lib/generic/math/fmod.cl b/libclc/opencl/lib/generic/math/fmod.cl
index 59d90c77fb62b..ddd071fdab95b 100644
--- a/libclc/opencl/lib/generic/math/fmod.cl
+++ b/libclc/opencl/lib/generic/math/fmod.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_fmod.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION fmod
 #define __CLC_BODY <clc/shared/binary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/fract.cl b/libclc/opencl/lib/generic/math/fract.cl
index 43f164fff312f..c3e8b0afee78d 100644
--- a/libclc/opencl/lib/generic/math/fract.cl
+++ b/libclc/opencl/lib/generic/math/fract.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_fract.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION fract
 #define __CLC_BODY <clc/math/unary_def_with_ptr.inc>
diff --git a/libclc/opencl/lib/generic/math/frexp.cl b/libclc/opencl/lib/generic/math/frexp.cl
index 77c87467b7937..940a8e37b5b59 100644
--- a/libclc/opencl/lib/generic/math/frexp.cl
+++ b/libclc/opencl/lib/generic/math/frexp.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_frexp.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION frexp
 #define __CLC_BODY <clc/math/unary_def_with_int_ptr.inc>
diff --git a/libclc/opencl/lib/generic/math/half_cos.cl b/libclc/opencl/lib/generic/math/half_cos.cl
index 9665626ecccd5..5bb91b8addbca 100644
--- a/libclc/opencl/lib/generic/math/half_cos.cl
+++ b/libclc/opencl/lib/generic/math/half_cos.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_cos.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_cos
diff --git a/libclc/opencl/lib/generic/math/half_divide.cl b/libclc/opencl/lib/generic/math/half_divide.cl
index 0c7519b346240..8b5d8eddd67a7 100644
--- a/libclc/opencl/lib/generic/math/half_divide.cl
+++ b/libclc/opencl/lib/generic/math/half_divide.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_divide.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_divide
diff --git a/libclc/opencl/lib/generic/math/half_exp.cl b/libclc/opencl/lib/generic/math/half_exp.cl
index be356775852b3..97507ab2e189a 100644
--- a/libclc/opencl/lib/generic/math/half_exp.cl
+++ b/libclc/opencl/lib/generic/math/half_exp.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_exp.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_exp
diff --git a/libclc/opencl/lib/generic/math/half_exp10.cl b/libclc/opencl/lib/generic/math/half_exp10.cl
index e47d955a449e9..6925035d05f7c 100644
--- a/libclc/opencl/lib/generic/math/half_exp10.cl
+++ b/libclc/opencl/lib/generic/math/half_exp10.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_exp10.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_exp10
diff --git a/libclc/opencl/lib/generic/math/half_exp2.cl b/libclc/opencl/lib/generic/math/half_exp2.cl
index 100bc02982df4..5bd244482ffa4 100644
--- a/libclc/opencl/lib/generic/math/half_exp2.cl
+++ b/libclc/opencl/lib/generic/math/half_exp2.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_exp2.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_exp2
diff --git a/libclc/opencl/lib/generic/math/half_log.cl b/libclc/opencl/lib/generic/math/half_log.cl
index b417a800b0e15..28c6964166983 100644
--- a/libclc/opencl/lib/generic/math/half_log.cl
+++ b/libclc/opencl/lib/generic/math/half_log.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_log.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_log
diff --git a/libclc/opencl/lib/generic/math/half_log10.cl b/libclc/opencl/lib/generic/math/half_log10.cl
index 974e4b899cb72..fcd0a818308c0 100644
--- a/libclc/opencl/lib/generic/math/half_log10.cl
+++ b/libclc/opencl/lib/generic/math/half_log10.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_log10.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_log10
diff --git a/libclc/opencl/lib/generic/math/half_log2.cl b/libclc/opencl/lib/generic/math/half_log2.cl
index 4e21d8f907757..05214e6f5a629 100644
--- a/libclc/opencl/lib/generic/math/half_log2.cl
+++ b/libclc/opencl/lib/generic/math/half_log2.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_log2.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_log2
diff --git a/libclc/opencl/lib/generic/math/half_powr.cl b/libclc/opencl/lib/generic/math/half_powr.cl
index 9b745313ce3cb..3562d3e286faf 100644
--- a/libclc/opencl/lib/generic/math/half_powr.cl
+++ b/libclc/opencl/lib/generic/math/half_powr.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_powr.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_powr
diff --git a/libclc/opencl/lib/generic/math/half_recip.cl b/libclc/opencl/lib/generic/math/half_recip.cl
index 9f0df658d81ba..e2650662372c8 100644
--- a/libclc/opencl/lib/generic/math/half_recip.cl
+++ b/libclc/opencl/lib/generic/math/half_recip.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_recip.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_recip
diff --git a/libclc/opencl/lib/generic/math/half_rsqrt.cl b/libclc/opencl/lib/generic/math/half_rsqrt.cl
index a4ea9100add20..4f287d72d6417 100644
--- a/libclc/opencl/lib/generic/math/half_rsqrt.cl
+++ b/libclc/opencl/lib/generic/math/half_rsqrt.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_rsqrt.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_rsqrt
diff --git a/libclc/opencl/lib/generic/math/half_sin.cl b/libclc/opencl/lib/generic/math/half_sin.cl
index 0756c54287e4d..c1e5696185102 100644
--- a/libclc/opencl/lib/generic/math/half_sin.cl
+++ b/libclc/opencl/lib/generic/math/half_sin.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_sin.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_sin
diff --git a/libclc/opencl/lib/generic/math/half_sqrt.cl b/libclc/opencl/lib/generic/math/half_sqrt.cl
index 654a1ff12cffd..c327881a553b8 100644
--- a/libclc/opencl/lib/generic/math/half_sqrt.cl
+++ b/libclc/opencl/lib/generic/math/half_sqrt.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_sqrt.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_sqrt
diff --git a/libclc/opencl/lib/generic/math/half_tan.cl b/libclc/opencl/lib/generic/math/half_tan.cl
index d9c60576e69ac..0d16b08dc2233 100644
--- a/libclc/opencl/lib/generic/math/half_tan.cl
+++ b/libclc/opencl/lib/generic/math/half_tan.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_half_tan.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_tan
diff --git a/libclc/opencl/lib/generic/math/hypot.cl b/libclc/opencl/lib/generic/math/hypot.cl
index c96e9243c99a4..3ac2983efc4bf 100644
--- a/libclc/opencl/lib/generic/math/hypot.cl
+++ b/libclc/opencl/lib/generic/math/hypot.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_hypot.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION hypot
 #define __CLC_BODY <clc/shared/binary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/ilogb.cl b/libclc/opencl/lib/generic/math/ilogb.cl
index bb38061ab31d6..147f82d95d1f0 100644
--- a/libclc/opencl/lib/generic/math/ilogb.cl
+++ b/libclc/opencl/lib/generic/math/ilogb.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_ilogb.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION ilogb
 #define __CLC_BODY <clc/math/unary_def_with_int_return.inc>
diff --git a/libclc/opencl/lib/generic/math/ldexp.cl b/libclc/opencl/lib/generic/math/ldexp.cl
index 5911ec9d9a8c9..e3b9b2b3f1363 100644
--- a/libclc/opencl/lib/generic/math/ldexp.cl
+++ b/libclc/opencl/lib/generic/math/ldexp.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_ldexp.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEFINE_BINARY_BUILTIN_NO_SCALARIZE(float, ldexp, __clc_ldexp, float, int)
 
diff --git a/libclc/opencl/lib/generic/math/lgamma.cl b/libclc/opencl/lib/generic/math/lgamma.cl
index 0c95094d3fc9e..002a08153a3a3 100644
--- a/libclc/opencl/lib/generic/math/lgamma.cl
+++ b/libclc/opencl/lib/generic/math/lgamma.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_lgamma.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION lgamma
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/lgamma_r.cl b/libclc/opencl/lib/generic/math/lgamma_r.cl
index f20583b56a2d5..c44051cb4c39a 100644
--- a/libclc/opencl/lib/generic/math/lgamma_r.cl
+++ b/libclc/opencl/lib/generic/math/lgamma_r.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_lgamma_r.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION lgamma_r
 #define __CLC_BODY <clc/math/unary_def_with_int_ptr.inc>
diff --git a/libclc/opencl/lib/generic/math/log.cl b/libclc/opencl/lib/generic/math/log.cl
index b41254c36e313..78430644a55ee 100644
--- a/libclc/opencl/lib/generic/math/log.cl
+++ b/libclc/opencl/lib/generic/math/log.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_log.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION log
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/log10.cl b/libclc/opencl/lib/generic/math/log10.cl
index 41e43ea1a105a..01113e7c00c92 100644
--- a/libclc/opencl/lib/generic/math/log10.cl
+++ b/libclc/opencl/lib/generic/math/log10.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_log10.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION log10
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/log1p.cl b/libclc/opencl/lib/generic/math/log1p.cl
index 40bc5d9e61c27..26c4df015bc88 100644
--- a/libclc/opencl/lib/generic/math/log1p.cl
+++ b/libclc/opencl/lib/generic/math/log1p.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_log1p.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION log1p
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/log2.cl b/libclc/opencl/lib/generic/math/log2.cl
index 861dfc18979d4..d70f16d6f7d89 100644
--- a/libclc/opencl/lib/generic/math/log2.cl
+++ b/libclc/opencl/lib/generic/math/log2.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_log2.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION log2
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/logb.cl b/libclc/opencl/lib/generic/math/logb.cl
index c3b9170e67302..21046f2ac98cf 100644
--- a/libclc/opencl/lib/generic/math/logb.cl
+++ b/libclc/opencl/lib/generic/math/logb.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_logb.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION logb
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/mad.cl b/libclc/opencl/lib/generic/math/mad.cl
index cee2a35c239e4..20e6903094454 100644
--- a/libclc/opencl/lib/generic/math/mad.cl
+++ b/libclc/opencl/lib/generic/math/mad.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_mad.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEFINE_TERNARY_BUILTIN(float, mad, __clc_mad, float, float, float)
 
diff --git a/libclc/opencl/lib/generic/math/maxmag.cl b/libclc/opencl/lib/generic/math/maxmag.cl
index ea31a8554dec8..cf4cfc7ded3a5 100644
--- a/libclc/opencl/lib/generic/math/maxmag.cl
+++ b/libclc/opencl/lib/generic/math/maxmag.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_maxmag.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION maxmag
 #define __CLC_BODY <clc/shared/binary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/minmag.cl b/libclc/opencl/lib/generic/math/minmag.cl
index 6c7b61c56f853..e636ca7e2c40a 100644
--- a/libclc/opencl/lib/generic/math/minmag.cl
+++ b/libclc/opencl/lib/generic/math/minmag.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_minmag.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION minmag
 #define __CLC_BODY <clc/shared/binary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/modf.cl b/libclc/opencl/lib/generic/math/modf.cl
index c7a4045694aad..7ad3a2c7550d9 100644
--- a/libclc/opencl/lib/generic/math/modf.cl
+++ b/libclc/opencl/lib/generic/math/modf.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_modf.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION modf
 #define __CLC_BODY <clc/math/unary_def_with_ptr.inc>
diff --git a/libclc/opencl/lib/generic/math/native_cos.cl b/libclc/opencl/lib/generic/math/native_cos.cl
index 933ebd2519b7c..d0df037716943 100644
--- a/libclc/opencl/lib/generic/math/native_cos.cl
+++ b/libclc/opencl/lib/generic/math/native_cos.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_cos.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_cos
diff --git a/libclc/opencl/lib/generic/math/native_divide.cl b/libclc/opencl/lib/generic/math/native_divide.cl
index ac4ad17cc0301..6bcc5ecf4d05b 100644
--- a/libclc/opencl/lib/generic/math/native_divide.cl
+++ b/libclc/opencl/lib/generic/math/native_divide.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_divide.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_divide
diff --git a/libclc/opencl/lib/generic/math/native_exp.cl b/libclc/opencl/lib/generic/math/native_exp.cl
index ddab9223dba9a..23b72fc82f8c0 100644
--- a/libclc/opencl/lib/generic/math/native_exp.cl
+++ b/libclc/opencl/lib/generic/math/native_exp.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_exp.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_exp
diff --git a/libclc/opencl/lib/generic/math/native_exp10.cl b/libclc/opencl/lib/generic/math/native_exp10.cl
index 082591285c4c0..76cbc57cb3ba5 100644
--- a/libclc/opencl/lib/generic/math/native_exp10.cl
+++ b/libclc/opencl/lib/generic/math/native_exp10.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_exp10.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_exp10
diff --git a/libclc/opencl/lib/generic/math/native_exp2.cl b/libclc/opencl/lib/generic/math/native_exp2.cl
index a4ca5f5ec5cbd..107db022b6e2b 100644
--- a/libclc/opencl/lib/generic/math/native_exp2.cl
+++ b/libclc/opencl/lib/generic/math/native_exp2.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_exp2.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_exp2
diff --git a/libclc/opencl/lib/generic/math/native_log.cl b/libclc/opencl/lib/generic/math/native_log.cl
index cc9018edacb8f..3faf70674fac8 100644
--- a/libclc/opencl/lib/generic/math/native_log.cl
+++ b/libclc/opencl/lib/generic/math/native_log.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_log.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_log
diff --git a/libclc/opencl/lib/generic/math/native_log10.cl b/libclc/opencl/lib/generic/math/native_log10.cl
index 75a019186725b..e71ac4448df25 100644
--- a/libclc/opencl/lib/generic/math/native_log10.cl
+++ b/libclc/opencl/lib/generic/math/native_log10.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_log10.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_log10
diff --git a/libclc/opencl/lib/generic/math/native_log2.cl b/libclc/opencl/lib/generic/math/native_log2.cl
index f54ea311ede76..c971013c4021d 100644
--- a/libclc/opencl/lib/generic/math/native_log2.cl
+++ b/libclc/opencl/lib/generic/math/native_log2.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_log2.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_log2
diff --git a/libclc/opencl/lib/generic/math/native_powr.cl b/libclc/opencl/lib/generic/math/native_powr.cl
index 0d7a022028bb6..ffc7e5a174377 100644
--- a/libclc/opencl/lib/generic/math/native_powr.cl
+++ b/libclc/opencl/lib/generic/math/native_powr.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_powr.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_powr
diff --git a/libclc/opencl/lib/generic/math/native_recip.cl b/libclc/opencl/lib/generic/math/native_recip.cl
index b93cfaa88b9a6..cad339ecb4f78 100644
--- a/libclc/opencl/lib/generic/math/native_recip.cl
+++ b/libclc/opencl/lib/generic/math/native_recip.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_recip.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_recip
diff --git a/libclc/opencl/lib/generic/math/native_rsqrt.cl b/libclc/opencl/lib/generic/math/native_rsqrt.cl
index d5506b335cda1..69a387387f336 100644
--- a/libclc/opencl/lib/generic/math/native_rsqrt.cl
+++ b/libclc/opencl/lib/generic/math/native_rsqrt.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_rsqrt.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_rsqrt
diff --git a/libclc/opencl/lib/generic/math/native_sin.cl b/libclc/opencl/lib/generic/math/native_sin.cl
index e201b8e7db868..c1a3faed39a26 100644
--- a/libclc/opencl/lib/generic/math/native_sin.cl
+++ b/libclc/opencl/lib/generic/math/native_sin.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_sin.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_sin
diff --git a/libclc/opencl/lib/generic/math/native_sqrt.cl b/libclc/opencl/lib/generic/math/native_sqrt.cl
index eb0311caa3451..5b5487cfea934 100644
--- a/libclc/opencl/lib/generic/math/native_sqrt.cl
+++ b/libclc/opencl/lib/generic/math/native_sqrt.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_sqrt.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_sqrt
diff --git a/libclc/opencl/lib/generic/math/native_tan.cl b/libclc/opencl/lib/generic/math/native_tan.cl
index 337e8537f22e7..000d6c5f366a1 100644
--- a/libclc/opencl/lib/generic/math/native_tan.cl
+++ b/libclc/opencl/lib/generic/math/native_tan.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_native_tan.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_tan
diff --git a/libclc/opencl/lib/generic/math/nextafter.cl b/libclc/opencl/lib/generic/math/nextafter.cl
index 3482f4f877c67..ecb187c53069e 100644
--- a/libclc/opencl/lib/generic/math/nextafter.cl
+++ b/libclc/opencl/lib/generic/math/nextafter.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_nextafter.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEFINE_BINARY_BUILTIN_NO_SCALARIZE(float, nextafter, __clc_nextafter,
                                         float, float)
diff --git a/libclc/opencl/lib/generic/math/pow.cl b/libclc/opencl/lib/generic/math/pow.cl
index 3730254513fa1..b3a77f5a2a71e 100644
--- a/libclc/opencl/lib/generic/math/pow.cl
+++ b/libclc/opencl/lib/generic/math/pow.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_pow.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION pow
 #define __CLC_BODY <clc/shared/binary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/pown.cl b/libclc/opencl/lib/generic/math/pown.cl
index 38b1e9031874f..a2ed523a41f74 100644
--- a/libclc/opencl/lib/generic/math/pown.cl
+++ b/libclc/opencl/lib/generic/math/pown.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_pown.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION pown
 #define __CLC_BODY <clc/math/binary_def_with_int_second_arg.inc>
diff --git a/libclc/opencl/lib/generic/math/powr.cl b/libclc/opencl/lib/generic/math/powr.cl
index 1878f1ed8aaaa..87707198aae15 100644
--- a/libclc/opencl/lib/generic/math/powr.cl
+++ b/libclc/opencl/lib/generic/math/powr.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_powr.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION powr
 #define __CLC_BODY <clc/shared/binary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/remainder.cl b/libclc/opencl/lib/generic/math/remainder.cl
index 8ec049b102e4a..aeba5d59e89a9 100644
--- a/libclc/opencl/lib/generic/math/remainder.cl
+++ b/libclc/opencl/lib/generic/math/remainder.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_remainder.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION remainder
 #define __CLC_BODY <clc/shared/binary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/remquo.cl b/libclc/opencl/lib/generic/math/remquo.cl
index 097c9cdb75386..94e7664edb4fe 100644
--- a/libclc/opencl/lib/generic/math/remquo.cl
+++ b/libclc/opencl/lib/generic/math/remquo.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_remquo.h>
+#include <clc/opencl/clc.h>
 
 #define __CLC_BODY <remquo.inc>
 #define __CLC_ADDRESS_SPACE global
diff --git a/libclc/opencl/lib/generic/math/rint.cl b/libclc/opencl/lib/generic/math/rint.cl
index ff593bc3ba35b..84ce99c4d216c 100644
--- a/libclc/opencl/lib/generic/math/rint.cl
+++ b/libclc/opencl/lib/generic/math/rint.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_rint.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION rint
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/rootn.cl b/libclc/opencl/lib/generic/math/rootn.cl
index a075699322260..9f737151b3903 100644
--- a/libclc/opencl/lib/generic/math/rootn.cl
+++ b/libclc/opencl/lib/generic/math/rootn.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_rootn.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION rootn
 #define __CLC_BODY <clc/math/binary_def_with_int_second_arg.inc>
diff --git a/libclc/opencl/lib/generic/math/round.cl b/libclc/opencl/lib/generic/math/round.cl
index 0f0257bb4faf6..0ce44e72b00aa 100644
--- a/libclc/opencl/lib/generic/math/round.cl
+++ b/libclc/opencl/lib/generic/math/round.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_round.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION round
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/rsqrt.cl b/libclc/opencl/lib/generic/math/rsqrt.cl
index 72c8b5fc55d72..7d6dcfaa3de7d 100644
--- a/libclc/opencl/lib/generic/math/rsqrt.cl
+++ b/libclc/opencl/lib/generic/math/rsqrt.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_rsqrt.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION rsqrt
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/sin.cl b/libclc/opencl/lib/generic/math/sin.cl
index 864adfb1d044c..293a2636c3070 100644
--- a/libclc/opencl/lib/generic/math/sin.cl
+++ b/libclc/opencl/lib/generic/math/sin.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_sin.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION sin
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/sincos.cl b/libclc/opencl/lib/generic/math/sincos.cl
index a2baf13ce6cba..d87da4d7df912 100644
--- a/libclc/opencl/lib/generic/math/sincos.cl
+++ b/libclc/opencl/lib/generic/math/sincos.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_sincos.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION sincos
 #define __CLC_BODY <clc/math/unary_def_with_ptr.inc>
diff --git a/libclc/opencl/lib/generic/math/sinh.cl b/libclc/opencl/lib/generic/math/sinh.cl
index 70cfb4f53ae8d..aa559f9330889 100644
--- a/libclc/opencl/lib/generic/math/sinh.cl
+++ b/libclc/opencl/lib/generic/math/sinh.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_sinh.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION sinh
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/sinpi.cl b/libclc/opencl/lib/generic/math/sinpi.cl
index f09307b489170..8b48426a0ef84 100644
--- a/libclc/opencl/lib/generic/math/sinpi.cl
+++ b/libclc/opencl/lib/generic/math/sinpi.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_sinpi.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION sinpi
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/sqrt.cl b/libclc/opencl/lib/generic/math/sqrt.cl
index f553d54a7ef27..fd031daf5bfbd 100644
--- a/libclc/opencl/lib/generic/math/sqrt.cl
+++ b/libclc/opencl/lib/generic/math/sqrt.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_sqrt.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION sqrt
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/tan.cl b/libclc/opencl/lib/generic/math/tan.cl
index af5b5659f8ca8..6df22b9c36959 100644
--- a/libclc/opencl/lib/generic/math/tan.cl
+++ b/libclc/opencl/lib/generic/math/tan.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_tan.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION tan
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/tanh.cl b/libclc/opencl/lib/generic/math/tanh.cl
index 2796f331a88db..ef7cb1ec5d861 100644
--- a/libclc/opencl/lib/generic/math/tanh.cl
+++ b/libclc/opencl/lib/generic/math/tanh.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_tanh.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION tanh
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/tanpi.cl b/libclc/opencl/lib/generic/math/tanpi.cl
index ab991cc90d312..2195830faf32d 100644
--- a/libclc/opencl/lib/generic/math/tanpi.cl
+++ b/libclc/opencl/lib/generic/math/tanpi.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_tanpi.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION tanpi
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/tgamma.cl b/libclc/opencl/lib/generic/math/tgamma.cl
index 8904b95236278..634ed7a506118 100644
--- a/libclc/opencl/lib/generic/math/tgamma.cl
+++ b/libclc/opencl/lib/generic/math/tgamma.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_tgamma.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION tgamma
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/math/trunc.cl b/libclc/opencl/lib/generic/math/trunc.cl
index 2f929a4a76c28..58f414dcc784c 100644
--- a/libclc/opencl/lib/generic/math/trunc.cl
+++ b/libclc/opencl/lib/generic/math/trunc.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_trunc.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION trunc
 #define __CLC_BODY <clc/shared/unary_def.inc>
diff --git a/libclc/opencl/lib/generic/misc/shuffle.cl b/libclc/opencl/lib/generic/misc/shuffle.cl
index ea4bca42e84c3..f8c5d16d21946 100644
--- a/libclc/opencl/lib/generic/misc/shuffle.cl
+++ b/libclc/opencl/lib/generic/misc/shuffle.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/misc/clc_shuffle.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION shuffle
 
diff --git a/libclc/opencl/lib/generic/misc/shuffle2.cl b/libclc/opencl/lib/generic/misc/shuffle2.cl
index 5894fe3bb8ce9..74487d07db3d9 100644
--- a/libclc/opencl/lib/generic/misc/shuffle2.cl
+++ b/libclc/opencl/lib/generic/misc/shuffle2.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/misc/clc_shuffle2.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION shuffle2
 
diff --git a/libclc/opencl/lib/generic/shared/clamp.inc b/libclc/opencl/lib/generic/shared/clamp.inc
index f3ef4476377df..f79a4da67f55a 100644
--- a/libclc/opencl/lib/generic/shared/clamp.inc
+++ b/libclc/opencl/lib/generic/shared/clamp.inc
@@ -6,12 +6,15 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE clamp(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_GENTYPE z) {
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE clamp(__CLC_GENTYPE x, __CLC_GENTYPE y,
+                                           __CLC_GENTYPE z) {
   return __clc_clamp(x, y, z);
 }
 
 #ifndef __CLC_SCALAR
-_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE clamp(__CLC_GENTYPE x, __CLC_SCALAR_GENTYPE y, __CLC_SCALAR_GENTYPE z) {
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE clamp(__CLC_GENTYPE x,
+                                           __CLC_SCALAR_GENTYPE y,
+                                           __CLC_SCALAR_GENTYPE z) {
   return __clc_clamp(x, y, z);
 }
 #endif
diff --git a/libclc/opencl/lib/generic/subnormal_config.cl b/libclc/opencl/lib/generic/subnormal_config.cl
index 326484b979b51..a32af9b0cf2e7 100644
--- a/libclc/opencl/lib/generic/subnormal_config.cl
+++ b/libclc/opencl/lib/generic/subnormal_config.cl
@@ -6,16 +6,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_subnormal_config.h>
+#include <clc/opencl/clc.h>
 
-_CLC_DEF bool __clc_fp16_subnormals_supported() {
-  return false;
-}
+_CLC_DEF bool __clc_fp16_subnormals_supported() { return false; }
 
-_CLC_DEF bool __clc_fp32_subnormals_supported() {
-  return false;
-}
+_CLC_DEF bool __clc_fp32_subnormals_supported() { return false; }
 
 _CLC_DEF bool __clc_fp64_subnormals_supported() {
   return !__clc_subnormals_disabled();
diff --git a/libclc/opencl/lib/generic/workitem/get_global_id.cl b/libclc/opencl/lib/generic/workitem/get_global_id.cl
index cd26995cbf0b5..26c3bf528cd4d 100644
--- a/libclc/opencl/lib/generic/workitem/get_global_id.cl
+++ b/libclc/opencl/lib/generic/workitem/get_global_id.cl
@@ -9,5 +9,6 @@
 #include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_global_id(uint dim) {
-  return get_group_id(dim) * get_local_size(dim) + get_local_id(dim) + get_global_offset(dim);
+  return get_group_id(dim) * get_local_size(dim) + get_local_id(dim) +
+         get_global_offset(dim);
 }
diff --git a/libclc/opencl/lib/generic/workitem/get_global_size.cl b/libclc/opencl/lib/generic/workitem/get_global_size.cl
index ed59dd6fcd4d0..747115d524885 100644
--- a/libclc/opencl/lib/generic/workitem/get_global_size.cl
+++ b/libclc/opencl/lib/generic/workitem/get_global_size.cl
@@ -9,5 +9,5 @@
 #include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_global_size(uint dim) {
-  return get_num_groups(dim)*get_local_size(dim);
+  return get_num_groups(dim) * get_local_size(dim);
 }
diff --git a/libclc/opencl/lib/ptx-nvidiacl/workitem/get_group_id.cl b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_group_id.cl
index dccd80c6ad6e7..0dad4c2061fe6 100644
--- a/libclc/opencl/lib/ptx-nvidiacl/workitem/get_group_id.cl
+++ b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_group_id.cl
@@ -10,9 +10,13 @@
 
 _CLC_DEF _CLC_OVERLOAD size_t get_group_id(uint dim) {
   switch (dim) {
-  case 0:  return __nvvm_read_ptx_sreg_ctaid_x();
-  case 1:  return __nvvm_read_ptx_sreg_ctaid_y();
-  case 2:  return __nvvm_read_ptx_sreg_ctaid_z();
-  default: return 0;
+  case 0:
+    return __nvvm_read_ptx_sreg_ctaid_x();
+  case 1:
+    return __nvvm_read_ptx_sreg_ctaid_y();
+  case 2:
+    return __nvvm_read_ptx_sreg_ctaid_z();
+  default:
+    return 0;
   }
 }
diff --git a/libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_id.cl b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_id.cl
index 2756b4501606d..199b4610bdb7b 100644
--- a/libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_id.cl
+++ b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_id.cl
@@ -10,9 +10,13 @@
 
 _CLC_DEF _CLC_OVERLOAD size_t get_local_id(uint dim) {
   switch (dim) {
-  case 0:  return __nvvm_read_ptx_sreg_tid_x();
-  case 1:  return __nvvm_read_ptx_sreg_tid_y();
-  case 2:  return __nvvm_read_ptx_sreg_tid_z();
-  default: return 0;
+  case 0:
+    return __nvvm_read_ptx_sreg_tid_x();
+  case 1:
+    return __nvvm_read_ptx_sreg_tid_y();
+  case 2:
+    return __nvvm_read_ptx_sreg_tid_z();
+  default:
+    return 0;
   }
 }
diff --git a/libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_size.cl b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_size.cl
index ab5fc36094e58..a93fa0a3c9649 100644
--- a/libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_size.cl
+++ b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_size.cl
@@ -10,9 +10,13 @@
 
 _CLC_DEF _CLC_OVERLOAD size_t get_local_size(uint dim) {
   switch (dim) {
-  case 0:  return __nvvm_read_ptx_sreg_ntid_x();
-  case 1:  return __nvvm_read_ptx_sreg_ntid_y();
-  case 2:  return __nvvm_read_ptx_sreg_ntid_z();
-  default: return 0;
+  case 0:
+    return __nvvm_read_ptx_sreg_ntid_x();
+  case 1:
+    return __nvvm_read_ptx_sreg_ntid_y();
+  case 2:
+    return __nvvm_read_ptx_sreg_ntid_z();
+  default:
+    return 0;
   }
 }
diff --git a/libclc/opencl/lib/ptx-nvidiacl/workitem/get_num_groups.cl b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_num_groups.cl
index 0ee4b42e237bc..4c934968df865 100644
--- a/libclc/opencl/lib/ptx-nvidiacl/workitem/get_num_groups.cl
+++ b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_num_groups.cl
@@ -10,9 +10,13 @@
 
 _CLC_DEF _CLC_OVERLOAD size_t get_num_groups(uint dim) {
   switch (dim) {
-  case 0:  return __nvvm_read_ptx_sreg_nctaid_x();
-  case 1:  return __nvvm_read_ptx_sreg_nctaid_y();
-  case 2:  return __nvvm_read_ptx_sreg_nctaid_z();
-  default: return 0;
+  case 0:
+    return __nvvm_read_ptx_sreg_nctaid_x();
+  case 1:
+    return __nvvm_read_ptx_sreg_nctaid_y();
+  case 2:
+    return __nvvm_read_ptx_sreg_nctaid_z();
+  default:
+    return 0;
   }
 }
diff --git a/libclc/opencl/lib/r600/image/get_image_channel_data_type.cl b/libclc/opencl/lib/r600/image/get_image_channel_data_type.cl
index 252676abca737..813572ae5d2d7 100644
--- a/libclc/opencl/lib/r600/image/get_image_channel_data_type.cl
+++ b/libclc/opencl/lib/r600/image/get_image_channel_data_type.cl
@@ -11,11 +11,9 @@
 _CLC_DECL int __clc_get_image_channel_data_type_2d(image2d_t);
 _CLC_DECL int __clc_get_image_channel_data_type_3d(image3d_t);
 
-_CLC_OVERLOAD _CLC_DEF int
-get_image_channel_data_type(image2d_t image) {
+_CLC_OVERLOAD _CLC_DEF int get_image_channel_data_type(image2d_t image) {
   return __clc_get_image_channel_data_type_2d(image);
 }
-_CLC_OVERLOAD _CLC_DEF int
-get_image_channel_data_type(image3d_t image) {
+_CLC_OVERLOAD _CLC_DEF int get_image_channel_data_type(image3d_t image) {
   return __clc_get_image_channel_data_type_3d(image);
 }
diff --git a/libclc/opencl/lib/r600/image/get_image_channel_order.cl b/libclc/opencl/lib/r600/image/get_image_channel_order.cl
index c9567dcb47378..0e5882b155079 100644
--- a/libclc/opencl/lib/r600/image/get_image_channel_order.cl
+++ b/libclc/opencl/lib/r600/image/get_image_channel_order.cl
@@ -11,11 +11,9 @@
 _CLC_DECL int __clc_get_image_channel_order_2d(image2d_t);
 _CLC_DECL int __clc_get_image_channel_order_3d(image3d_t);
 
-_CLC_OVERLOAD _CLC_DEF int
-get_image_channel_order(image2d_t image) {
+_CLC_OVERLOAD _CLC_DEF int get_image_channel_order(image2d_t image) {
   return __clc_get_image_channel_order_2d(image);
 }
-_CLC_OVERLOAD _CLC_DEF int
-get_image_channel_order(image3d_t image) {
+_CLC_OVERLOAD _CLC_DEF int get_image_channel_order(image3d_t image) {
   return __clc_get_image_channel_order_3d(image);
 }
diff --git a/libclc/opencl/lib/r600/image/get_image_depth.cl b/libclc/opencl/lib/r600/image/get_image_depth.cl
index af2809cefa113..431889b6ca258 100644
--- a/libclc/opencl/lib/r600/image/get_image_depth.cl
+++ b/libclc/opencl/lib/r600/image/get_image_depth.cl
@@ -10,7 +10,6 @@
 
 _CLC_DECL int __clc_get_image_depth_3d(image3d_t);
 
-_CLC_OVERLOAD _CLC_DEF int
-get_image_depth(image3d_t image) {
-	return __clc_get_image_depth_3d(image);
+_CLC_OVERLOAD _CLC_DEF int get_image_depth(image3d_t image) {
+  return __clc_get_image_depth_3d(image);
 }
diff --git a/libclc/opencl/lib/r600/image/get_image_dim.cl b/libclc/opencl/lib/r600/image/get_image_dim.cl
index 899d9238713a0..5a123425a2910 100644
--- a/libclc/opencl/lib/r600/image/get_image_dim.cl
+++ b/libclc/opencl/lib/r600/image/get_image_dim.cl
@@ -8,10 +8,10 @@
 
 #include <clc/opencl/clc.h>
 
-_CLC_OVERLOAD _CLC_DEF int2 get_image_dim (image2d_t image) {
+_CLC_OVERLOAD _CLC_DEF int2 get_image_dim(image2d_t image) {
   return (int2)(get_image_width(image), get_image_height(image));
 }
-_CLC_OVERLOAD _CLC_DEF int4 get_image_dim (image3d_t image) {
+_CLC_OVERLOAD _CLC_DEF int4 get_image_dim(image3d_t image) {
   return (int4)(get_image_width(image), get_image_height(image),
                 get_image_depth(image), 0);
 }
diff --git a/libclc/opencl/lib/r600/image/get_image_height.cl b/libclc/opencl/lib/r600/image/get_image_height.cl
index f4d5371e24da9..0c498bed8e608 100644
--- a/libclc/opencl/lib/r600/image/get_image_height.cl
+++ b/libclc/opencl/lib/r600/image/get_image_height.cl
@@ -11,11 +11,9 @@
 _CLC_DECL int __clc_get_image_height_2d(image2d_t);
 _CLC_DECL int __clc_get_image_height_3d(image3d_t);
 
-_CLC_OVERLOAD _CLC_DEF int
-get_image_height(image2d_t image) {
+_CLC_OVERLOAD _CLC_DEF int get_image_height(image2d_t image) {
   return __clc_get_image_height_2d(image);
 }
-_CLC_OVERLOAD _CLC_DEF int
-get_image_height(image3d_t image) {
+_CLC_OVERLOAD _CLC_DEF int get_image_height(image3d_t image) {
   return __clc_get_image_height_3d(image);
 }
diff --git a/libclc/opencl/lib/r600/image/get_image_width.cl b/libclc/opencl/lib/r600/image/get_image_width.cl
index 69b61a5f451df..c54f66176e764 100644
--- a/libclc/opencl/lib/r600/image/get_image_width.cl
+++ b/libclc/opencl/lib/r600/image/get_image_width.cl
@@ -11,11 +11,9 @@
 _CLC_DECL int __clc_get_image_width_2d(image2d_t);
 _CLC_DECL int __clc_get_image_width_3d(image3d_t);
 
-_CLC_OVERLOAD _CLC_DEF int
-get_image_width(image2d_t image) {
+_CLC_OVERLOAD _CLC_DEF int get_image_width(image2d_t image) {
   return __clc_get_image_width_2d(image);
 }
-_CLC_OVERLOAD _CLC_DEF int
-get_image_width(image3d_t image) {
+_CLC_OVERLOAD _CLC_DEF int get_image_width(image3d_t image) {
   return __clc_get_image_width_3d(image);
 }
diff --git a/libclc/opencl/lib/r600/image/read_imagei.cl b/libclc/opencl/lib/r600/image/read_imagei.cl
index dc76b7c8d0549..918a444f90a11 100644
--- a/libclc/opencl/lib/r600/image/read_imagei.cl
+++ b/libclc/opencl/lib/r600/image/read_imagei.cl
@@ -14,7 +14,7 @@ int4 __clc_reinterpret_v4f_to_v4i(float4 v) {
   union {
     int4 v4i;
     float4 v4f;
-  } res = { .v4f = v};
+  } res = {.v4f = v};
   return res.v4i;
 }
 
@@ -22,10 +22,10 @@ _CLC_OVERLOAD _CLC_DEF int4 read_imagei(image2d_t image, sampler_t sampler,
                                         int2 coord) {
   float2 coord_float = (float2)(coord.x, coord.y);
   return __clc_reinterpret_v4f_to_v4i(
-    __clc_read_imagef_tex(image, sampler, coord_float));
+      __clc_read_imagef_tex(image, sampler, coord_float));
 }
 _CLC_OVERLOAD _CLC_DEF int4 read_imagei(image2d_t image, sampler_t sampler,
                                         float2 coord) {
   return __clc_reinterpret_v4f_to_v4i(
-    __clc_read_imagef_tex(image, sampler, coord));
+      __clc_read_imagef_tex(image, sampler, coord));
 }
diff --git a/libclc/opencl/lib/r600/image/read_imageui.cl b/libclc/opencl/lib/r600/image/read_imageui.cl
index 8dd1870732967..8236b542ea0e8 100644
--- a/libclc/opencl/lib/r600/image/read_imageui.cl
+++ b/libclc/opencl/lib/r600/image/read_imageui.cl
@@ -14,7 +14,7 @@ uint4 __clc_reinterpret_v4f_to_v4ui(float4 v) {
   union {
     uint4 v4ui;
     float4 v4f;
-  } res = { .v4f = v};
+  } res = {.v4f = v};
   return res.v4ui;
 }
 
@@ -22,10 +22,10 @@ _CLC_OVERLOAD _CLC_DEF uint4 read_imageui(image2d_t image, sampler_t sampler,
                                           int2 coord) {
   float2 coord_float = (float2)(coord.x, coord.y);
   return __clc_reinterpret_v4f_to_v4ui(
-    __clc_read_imagef_tex(image, sampler, coord_float));
+      __clc_read_imagef_tex(image, sampler, coord_float));
 }
 _CLC_OVERLOAD _CLC_DEF uint4 read_imageui(image2d_t image, sampler_t sampler,
                                           float2 coord) {
   return __clc_reinterpret_v4f_to_v4ui(
-    __clc_read_imagef_tex(image, sampler, coord));
+      __clc_read_imagef_tex(image, sampler, coord));
 }
diff --git a/libclc/opencl/lib/r600/image/write_imagef.cl b/libclc/opencl/lib/r600/image/write_imagef.cl
index ea8a5f74ca3b4..d9784f5322c94 100644
--- a/libclc/opencl/lib/r600/image/write_imagef.cl
+++ b/libclc/opencl/lib/r600/image/write_imagef.cl
@@ -10,8 +10,7 @@
 
 _CLC_DECL void __clc_write_imagef_2d(image2d_t image, int2 coord, float4 color);
 
-_CLC_OVERLOAD _CLC_DEF void
-write_imagef(image2d_t image, int2 coord, float4 color)
-{
+_CLC_OVERLOAD _CLC_DEF void write_imagef(image2d_t image, int2 coord,
+                                         float4 color) {
   __clc_write_imagef_2d(image, coord, color);
 }
diff --git a/libclc/opencl/lib/r600/image/write_imagei.cl b/libclc/opencl/lib/r600/image/write_imagei.cl
index e89c5972c1657..ced65184071b3 100644
--- a/libclc/opencl/lib/r600/image/write_imagei.cl
+++ b/libclc/opencl/lib/r600/image/write_imagei.cl
@@ -10,8 +10,7 @@
 
 _CLC_DECL void __clc_write_imagei_2d(image2d_t image, int2 coord, int4 color);
 
-_CLC_OVERLOAD _CLC_DEF void
-write_imagei(image2d_t image, int2 coord, int4 color)
-{
+_CLC_OVERLOAD _CLC_DEF void write_imagei(image2d_t image, int2 coord,
+                                         int4 color) {
   __clc_write_imagei_2d(image, coord, color);
 }
diff --git a/libclc/opencl/lib/r600/image/write_imageui.cl b/libclc/opencl/lib/r600/image/write_imageui.cl
index 0e047fa7bbf97..ef2ee5a835ec7 100644
--- a/libclc/opencl/lib/r600/image/write_imageui.cl
+++ b/libclc/opencl/lib/r600/image/write_imageui.cl
@@ -10,8 +10,7 @@
 
 _CLC_DECL void __clc_write_imageui_2d(image2d_t image, int2 coord, uint4 color);
 
-_CLC_OVERLOAD _CLC_DEF void
-write_imageui(image2d_t image, int2 coord, uint4 color)
-{
+_CLC_OVERLOAD _CLC_DEF void write_imageui(image2d_t image, int2 coord,
+                                          uint4 color) {
   __clc_write_imageui_2d(image, coord, color);
 }
diff --git a/libclc/opencl/lib/r600/workitem/get_global_offset.cl b/libclc/opencl/lib/r600/workitem/get_global_offset.cl
index cc42fe4beef0c..aacaa52382263 100644
--- a/libclc/opencl/lib/r600/workitem/get_global_offset.cl
+++ b/libclc/opencl/lib/r600/workitem/get_global_offset.cl
@@ -9,9 +9,8 @@
 #include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD uint get_global_offset(uint dim) {
-  __attribute__((address_space(7))) uint *ptr =
-      (__attribute__((address_space(7)))
-       uint *)__builtin_r600_implicitarg_ptr();
+  __attribute__((address_space(7))) uint *ptr = (
+      __attribute__((address_space(7))) uint *)__builtin_r600_implicitarg_ptr();
   if (dim < 3)
     return ptr[dim + 1];
   return 0;
diff --git a/libclc/opencl/lib/r600/workitem/get_work_dim.cl b/libclc/opencl/lib/r600/workitem/get_work_dim.cl
index b59dd3af6c334..9c6220ca6ba35 100644
--- a/libclc/opencl/lib/r600/workitem/get_work_dim.cl
+++ b/libclc/opencl/lib/r600/workitem/get_work_dim.cl
@@ -9,8 +9,7 @@
 #include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD uint get_work_dim(void) {
-  __attribute__((address_space(7))) uint *ptr =
-      (__attribute__((address_space(7)))
-       uint *)__builtin_r600_implicitarg_ptr();
+  __attribute__((address_space(7))) uint *ptr = (
+      __attribute__((address_space(7))) uint *)__builtin_r600_implicitarg_ptr();
   return ptr[0];
 }
diff --git a/libclc/opencl/lib/spirv/math/fma.cl b/libclc/opencl/lib/spirv/math/fma.cl
index 014e311ff91a4..2722018121224 100644
--- a/libclc/opencl/lib/spirv/math/fma.cl
+++ b/libclc/opencl/lib/spirv/math/fma.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/internal/math/clc_sw_fma.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEFINE_TERNARY_BUILTIN(float, fma, __clc_sw_fma, float, float, float)
diff --git a/libclc/opencl/lib/spirv/subnormal_config.cl b/libclc/opencl/lib/spirv/subnormal_config.cl
index 50997134bcd99..77d60ab9cbbde 100644
--- a/libclc/opencl/lib/spirv/subnormal_config.cl
+++ b/libclc/opencl/lib/spirv/subnormal_config.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/opencl/clc.h>
 #include <clc/math/clc_subnormal_config.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF bool __clc_fp16_subnormals_supported() { return false; }
 

>From 054e8185bf12dcf0cd5f599f53e253a88680fa86 Mon Sep 17 00:00:00 2001
From: Fraser Cormack <fraser at codeplay.com>
Date: Mon, 19 May 2025 16:10:13 +0100
Subject: [PATCH 3/3] fix python formatting

---
 libclc/utils/gen_convert.py | 2 --
 1 file changed, 2 deletions(-)

diff --git a/libclc/utils/gen_convert.py b/libclc/utils/gen_convert.py
index 21e297cb25b73..02893dbad6a37 100644
--- a/libclc/utils/gen_convert.py
+++ b/libclc/utils/gen_convert.py
@@ -355,7 +355,6 @@ def generate_saturated_conversion(src, dst, size):
         print("  return x;")
 
     elif src in float_types:
-
         # Conversion from float to int
         print(
             f"""  {dstn} y = __clc_convert_{dstn}(x);
@@ -364,7 +363,6 @@ def generate_saturated_conversion(src, dst, size):
   return y;"""
         )
     else:
-
         # Integer to integer convesion with sizeof(src) == sizeof(dst)
         if sizeof_type[src] == sizeof_type[dst]:
             if src in unsigned_types:



More information about the cfe-commits mailing list