• Home
  • History
  • Annotate
  • only in /external/mesa3d/src/gallium/state_trackers/clover/
History log of /external/mesa3d/src/gallium/state_trackers/clover/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6741256351a34c656f12e78978a6f8f988e9ec18 02-Mar-2017 Jan Vesely <jan.vesely@rutgers.edu> clover: use pipe_resource references

v2: buffers are created with one reference.
v3: add pipe_resource reference to mapping object
v4: rename to pres and drop inline initializers

CC: "17.0 13.0" <mesa-stable@lists.freedesktop.org>

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
(cherry picked from commit 14b543bdc94df06897f98057c40df84b16f2e944)
ore/resource.cpp
ore/resource.hpp
ce7f3521dee76c21e28c92ca8a8f0c09f2efdf96 02-Mar-2017 Matt Turner <mattst88@gmail.com> clover: Work around build failure with AltiVec.

Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=587210
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68504
Acked-by: Francisco Jerez <currojerez@riseup.net>
(cherry picked from commit 7d1195c1e4d071fe796bf5f210c468ea1cc86225)
akefile.am
89ce0721ebac2d14267b79d0c1849eb25f018894 16-Jan-2017 Emil Velikov <emil.velikov@collabora.com> clover: automake: include builddir prior to srcdir

Analogous to previous commit.

Cc: "12.0 13.0" <mesa-dev@lists.freedesktop.org>
Cc: Aaron Watry <awatry@gmail.com>
Cc: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 65d5a60caca632a7c03cd1dc554645f27f408f37)
akefile.am
4e0d171d7eb6accbf8f381530eedbc9ff86b54fb 30-Dec-2016 Pierre Moreau <pierre.morrow@free.fr> clover: Check for executables before enqueueing a kernel

Without this check, the kernel::bind() method would fail with a
std::out_of_range exception, letting an exception escape from the
library into the client, rather than returning the corresponding error
code CL_INVALID_PROGRAM_EXECUTABLE.

Signed-off-by: Pierre Moreau <pierre.morrow@free.fr>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/kernel.cpp
d9fef848a651b47520cbeb72c38b93d4fbf842a8 21-Dec-2016 Vedran Miletić <vedran@miletic.net> clover: Use Clang's diagnostics

Presently errors from frontend are handled only if they occur in
clang::CompilerInvocation::CreateFromArgs(). This patch uses
clang::DiagnosticsEngine to detect errors such as invalid values for
Clang frontend arguments.

Fixes Piglit's cl/program/build/fail/invalid-version-declaration.cl
test.

v2: fix inconsistent code formatting

Signed-off-by: Vedran Miletić <vedran@miletic.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Tested-by: Aaron Watry <awatry@gmail.com>
lvm/invocation.cpp
95ddb37708ca16ccbd0f607d17a82be2de0d07b6 22-Nov-2016 Vedran Miletić <vedran@miletic.net> clover: Restore support for LLVM <= 3.9.

The commit 8e430ff8b060b4e8e922bae24b3c57837da6ea77 broke support for
LLVM 3.9 and older versions in Clover. This patch restores it and
refactors the support using Clover compatibility layer for LLVM.

v2: merged #ifdef blocks
v3: added support for LLVM 3.6-3.8
v4: add missing #ifdef around <memory>
v5: simplify using templates and lambda

Signed-off-by: Vedran Miletić <vedran@miletic.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98740
Tested-by[v4]: Pierre Moreau <pierre.morrow@free.fr>
Tested-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/codegen/bitcode.cpp
lvm/compat.hpp
8e430ff8b060b4e8e922bae24b3c57837da6ea77 14-Nov-2016 Vedran Miletić <vedran@miletic.net> clover: adapt to new error API since LLVM r286752

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
lvm/codegen/bitcode.cpp
3ff9f8c5328310a463d3f16f573b68aa20ab8339 11-Nov-2016 Laurent Carlier <lordheavym@gmail.com> clover: fix building since llvm r286566

pretty trivial fix
lvm/codegen/bitcode.cpp
cc495055cdfe7e39002180d095d09fe4b6905eb9 31-Oct-2016 Serge Martin <edb+mesa@sigluy.net> clover: Add CL_PROGRAM_BINARY_TYPE support (CL1.2).

v3 [Francisco Jerez]: Loosely based on Serge's v1 of this patch in
order to avoid CL-specific enums in the clover module binary
format. In addition to other changes made in v2: Represent the CL
program binary type as the section type instead of adding a CL
API-specific enum, check that the binary types of the input objects
are valid during clLinkProgram(), pass section type as argument to
build_module_library() instead of using separate function.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/program.cpp
ore/kernel.cpp
ore/module.hpp
ore/program.cpp
ore/program.hpp
lvm/codegen.hpp
lvm/codegen/bitcode.cpp
lvm/codegen/common.cpp
lvm/invocation.cpp
gsi/compiler.cpp
05fcc73f087fa2b8c447ec8c79c7bdab57d49faf 01-Oct-2016 Serge Martin <edb+mesa@sigluy.net> clover: add missing clGetDeviceInfo CL1.2 queries

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Vedran Miletić <vedran@miletic.net>
pi/device.cpp
ore/device.cpp
ore/device.hpp
cb0879985a40bcde1516e5341c5a3e5ea0968b87 27-Sep-2015 Serge Martin <edb+mesa@sigluy.net> clover: Implement clGetExtensionFunctionAddressForPlatform.

Add clGetExtensionFunctionAddressForPlatform (CL 1.2).

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/dispatch.cpp
pi/dispatch.hpp
pi/platform.cpp
2fba72046da09dd28f54df02794b358773899d13 28-Sep-2016 Vedran Miletić <vedran@miletic.net> clover: Introduce CLOVER_EXTRA_*_OPTIONS environment variables

The options specified in the CLOVER_EXTRA_BUILD_OPTIONS shell
variable are appended to the options specified by the OpenCL program
in the clBuildProgram function call, if any.
Analogously, the options specified in the CLOVER_EXTRA_COMPILE_OPTIONS
and CLOVER_EXTRA_LINK_OPTIONS variables are appended to the options
specified in clCompileProgram and clLinkProgram function calls,
respectively.

v2:
* rename to CLOVER_EXTRA_COMPILER_OPTIONS
* use debug_get_option
* append to linker options as well

v3: code cleanups

v4: separate CLOVER_EXTRA_LINKER_OPTIONS options

v5:
* fix documentation typo
* use CLOVER_EXTRA_COMPILER_OPTIONS in link stage

v6:
* separate in CLOVER_EXTRA_{BUILD,COMPILE,LINK}_OPTIONS
* append options in cl{Build,Compile,Link}Program

Signed-off-by: Vedran Miletić <vedran@miletic.net>
Reviewed-by[v1]: Edward O'Callaghan <funfunctor@folklore1984.net>

v7 [Francisco Jerez]: Slight simplification.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/program.cpp
e3272865c216933168e6c08766d266a33d0e1497 28-Sep-2016 Vedran Miletić <vedran@miletic.net> clover: Pass unquoted compiler arguments to Clang

OpenCL apps can quote arguments they pass to the OpenCL compiler, most
commonly include paths containing spaces.

If the Clang OpenCL compiler was called via a shell, the shell would
split the arguments with respect to to quotes and then remove quotes
before passing the arguments to the compiler. Since we call Clang as a
library, we have to split the argument with respect to quotes and then
remove quotes before passing the arguments.

v2: move to tokenize(), remove throwing of CL_INVALID_COMPILER_OPTIONS

v3: simplify parsing logic, use more C++11

v4: restore error throwing, clarify a comment

Signed-off-by: Vedran Miletić <vedran@miletic.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/util.hpp
1c8d4c694bfb95ab90f152da710a8a9459a20228 30-Aug-2016 Serge Martin <edb+mesa@sigluy.net> clover: fix getting scalar args api size

This fix getting the size of a struct arg. vec3 types still work ok.
Only buit-in args need to have power of two alignment, getTypeAllocSize
reports the correct size in all cases.

Acked-by: Francisco Jerez <currojerez@riseup.net>
lvm/codegen/common.cpp
cfa914a1b4e20e7ef416171f5212f21e8224befc 28-Aug-2016 Niels Ole Salscheider <niels_ole@salscheider-online.de> st/clover: Define __OPENCL_VERSION__ on the device side

This is required by the OpenCL standard.

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Vedran Miletić <vedran@miletic.net>
lvm/invocation.cpp
5981ab544562c667c882526c31a6f8c2ce6eba12 07-Sep-2016 Marek Olšák <marek.olsak@amd.com> gallium: remove PIPE_BIND_TRANSFER_READ/WRITE

not used in any useful way

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
ore/format.cpp
ore/resource.cpp
083746bc4811944dcc25c5b6589d7df1bc95eb02 28-Aug-2016 Jan Vesely <jan.vesely@rutgers.edu> clover: Use device cap to query pointer size instead of hardcoded 32bits

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97513
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/device.cpp
ore/device.cpp
ore/device.hpp
54272e18a682c8b82d4a86b2c07b51c303d8cead 06-Aug-2016 Marek Olšák <marek.olsak@amd.com> gallium: add a pipe_context parameter to fence_finish

required by glClientWaitSync (GL 4.5 Core spec) that can optionally flush
the context

Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
ore/event.cpp
041b330a3204d894fe95b5bae6a740936a7ebc0f 28-Jul-2016 Dieter Nützel <Dieter@nuetzel-hh.de> clover: make GCC 4.8 happy

Without this GCC 4.8.x throws below error:

error: invalid initialization of non-const reference of type
'clover::llvm::compat::raw_ostream_to_emit_file {aka llvm::raw_svector_ostream&}'
from an rvalue of type '<brace-enclosed initializer list>'

v2: change commit title and add error message like Eric Engestrom requested

Signed-off-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97019
[ Francisco Jerez: Trivial formatting fix. ]
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/codegen/native.cpp
1ffe77e7bb2486ea74cda077ed2a9622b758395c 16-Jul-2016 Marek Olšák <marek.olsak@amd.com> gallium: split transfer_inline_write into buffer and texture callbacks

to reduce the call indirections with u_resource_vtbl.

The worst call tree you could get was:
- u_transfer_inline_write_vtbl
- u_default_transfer_inline_write
- u_transfer_map_vtbl
- driver_transfer_map
- u_transfer_unmap_vtbl
- driver_transfer_unmap

That's 6 indirect calls. Some drivers only had 5. The goal is to have
1 indirect call for drivers that care. The resource type can be determined
statically at most call sites.

The new interface is:
pipe_context::buffer_subdata(ctx, resource, usage, offset, size, data)
pipe_context::texture_subdata(ctx, resource, level, usage, box, data,
stride, layer_stride)

v2: fix whitespace, correct ilo's behavior

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Acked-by: Roland Scheidegger <sroland@vmware.com>
ore/resource.cpp
106946153fb237e0867d65d53fb3a8461f3a13ee 19-Jul-2016 Tom Stellard <thomas.stellard@amd.com> clover: Re-order includes in invocation.cpp to fix build

The build was failing because the official CL headers have a few defines,
like: # define cl_khr_gl_sharing 1

Which have the same name as some class members of clang's OpenCLOptions class.
If we include the cl headers first, this breaks the build because the member
names of this class are replaced by the literal 1.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Vedran Miletić <vedran@miletic.net>
lvm/invocation.cpp
a73bf11a63ea93640c26b5701c533b06d3a6f3e9 19-Jul-2016 Tom Stellard <thomas.stellard@amd.com> clover: Add missing include v2

clang commit r275822 removed unnecessary includes from header files,
so we now need to explicitly include clang/Lex/PreprocessorOptions.h

v2:
- Use <> instead of "" for the include path.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Vedran Miletić <vedran@miletic.net>
lvm/invocation.cpp
e30069630407e49008aaa160acb4c5684532b2c2 06-Jun-2016 Francisco Jerez <currojerez@riseup.net> clover/api: Implement clLinkProgram per-device binary presence validation rule.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
pi/program.cpp
f29ed2da2423c8be8a6745f4e98ee16cd699533e 09-May-2016 Serge Martin <edb+mesa@sigluy.net> clover: Add clLinkProgram (CL 1.2).

[ Francisco Jerez: Use validate_build_common for error checking,
simplify control flow slightly and handle additional exception
types. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
pi/program.cpp
c478db6c0a54307b0ec816e63e86deb04a130b9c 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover: Trivial cleanups for api/program.cpp.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
pi/program.cpp
9c7cda27929364804b34424bf4568d767490316d 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/core: Remove compiler.hpp.

header_map was the only definition left in compiler.hpp, move it into
program.hpp which is its only user in clover/core.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
akefile.sources
ore/compiler.hpp
ore/program.hpp
lvm/invocation.hpp
c2e37fe1f95916c7669fe84118acd2e3683ae077 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Get rid of compile_program_llvm().

Superseded by compile_program() and link_program().

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
ore/compiler.hpp
lvm/invocation.cpp
010918f5aa78f51dda6c98a639f6f4422e9be2e5 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover: Provide separate program methods for compilation and linking.

[ Serge Martin: Fix inverted opts and log build ctor args.
Keep the log related to the build. Fix indentation ]

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
pi/program.cpp
ore/program.cpp
ore/program.hpp
1942490bae01d44a08f263ea2dc747d11c82acfe 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover: Unify program::build_* into a single method returning a struct.

This gets rid of the program::build_* query methods and replaces them
with the program::build() method that returns a single data structure
containing all parameters for the last build done on the given target
device (including build logs, options and the binary itself).

[ Serge Martin: Fix inverted opts and log build ctor args ]

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
pi/program.cpp
ore/kernel.cpp
ore/program.cpp
ore/program.hpp
7f6a4a4342c1444990c55a77c60516c38738d203 17-May-2016 Serge Martin <edb+mesa@sigluy.net> clover: Change program::build opts argument to std::string.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
ore/program.cpp
ore/program.hpp
2a73ae662cb393bef0d2d0ab71bfd1072adbafb6 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover: Define error subclass to signal build option parse failure.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
pi/program.cpp
ore/error.hpp
lvm/invocation.cpp
4ef1c0918da4363aa20b7c1a91d344fae6c01942 19-Jun-2016 Francisco Jerez <currojerez@riseup.net> clover: Move back to using build_error to signal compilation failure.

This partially reverts 7e0180d57d330bd8d3047e841086712376b2a1cc.
Having two different exception subclasses for compilation and linking
makes it more difficult to share or move code between the two
codepaths, because the exact same function under the same error
condition would need to throw one exception or the other depending on
what top-level API is being implemented with it. There is little
benefit anyway because clCompileProgram() and clLinkProgram() can tell
whether they are linking or compiling a program.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
pi/program.cpp
ore/error.hpp
lvm/codegen/native.cpp
lvm/invocation.cpp
gsi/compiler.cpp
70fe6267a37dfc97ef8b6dd22a0431fcfc293d2a 17-May-2016 Serge Martin <edb+mesa@sigluy.net> clover: Override ret_object.

Return an API object from an intrusive reference to a Clover object,
incrementing the reference count of the object.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
pi/util.hpp
85309e8b55419f7d80dcf7e962e54e00f6acb05c 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/tgsi: Add stub link_program() function.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
gsi/compiler.cpp
gsi/invocation.hpp
ba613636e8a0f16e0386dc7dc88529f7027eecea 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/tgsi: Move compiler entry point declaration into tgsi directory and namespace.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
akefile.sources
ore/compiler.hpp
ore/program.cpp
gsi/compiler.cpp
gsi/invocation.hpp
fb3eeb1314c3269818e58e64b460d045ea5b466d 04-Jun-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Implement the -create-library linker option.

[ Serge Martin: disable internalize pass when building a library.
Otherwise some functions may be inlined and removed ]

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
til/functional.hpp
9de3f4a59f2f588368a5994a9fe49d4136393852 13-Jun-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Implement linkage of multiple clover modules.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/compat.hpp
lvm/invocation.cpp
132b6ccd4f81eac3cad5bef42325319708498240 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Split compilation and linking.

Split the work previously done by compile_program_llvm() into
compile_program() (which simply runs the front-end and serializes the
resulting LLVM IR) and link_program() (which takes care of everything
else down to binary codegen).

[ Serge Martin: allow LLVM IR dump after compilation ]

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
akefile.sources
lvm/invocation.cpp
lvm/invocation.hpp
1a7d11aa3dc65e89f0d801707951afc32cbaa6ee 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Implement library bitcode codegen.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/codegen.hpp
lvm/codegen/bitcode.cpp
86100e13abc6182d2dd51eeb491b113d5a070fa1 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Trivial assorted cleanups for invocation.cpp.

Drop a few include and using directives which are no longer necessary.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
520cc268593edad750d0dbab520a715c31a5c230 20-Jun-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Split native codegen into separate file.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
akefile.sources
lvm/codegen.hpp
lvm/codegen/native.cpp
lvm/invocation.cpp
8195637363c9a5d979831405390157b11ecfc170 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Split bitcode codegen into separate file.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
akefile.sources
lvm/codegen.hpp
lvm/codegen/bitcode.cpp
lvm/invocation.cpp
71ac9820d6c612a3a0cd8fcea87f7f2bde82d640 04-Jul-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Split shared codegen support code into separate file.

This is the common part of the code used to generate a clover::module
from LLVM bitcode, shared between the native and LLVM paths.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
akefile.sources
lvm/codegen.hpp
lvm/codegen/common.cpp
lvm/invocation.cpp
26fa9bfd0dfccf06358180ae740121522d09b51f 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Define function for bitcode print-out.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
f0721020ad6ba20110705cb1d927de09e0e25edc 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Split native codegen and assembly print-out into separate functions.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
1d042adc0a0a47e343ce29c15ac6767c824a8e9c 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Clean up bitcode codegen.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
952d1e6fd68abd13a35748529bdca5c8356eba69 28-Jun-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Use metadata introspection utils for kernel enumeration.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
d37d5842c16dd104fa60dec28aaef1863b094aa3 04-Jul-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Use metadata introspection utils for kernel argument set-up.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
3ed31bbf057660909b6a9a20ac240ffad7dd34f0 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Add simplified utility functions for metadata introspection.

v2: Fix for latest LLVM from SVN.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net> (v1)
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
akefile.sources
lvm/metadata.hpp
7da2c1ff0f9d48287ef1ae7d484bafb2a98cd639 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Clean up codestyle of get_kernel_args().

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
0601fe74389b23ae1094e730a5681aed3af84629 28-Jun-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Fold compile_native() call into build_module_native().

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
f98422eafdd9f37f293970f908a87b81351b5ed4 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Factor out duplicated construction of clover::module.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
3ce6ab068ced4341bbb404df12fb9bcca294e94c 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Clean up compile_native().

This switches compile_native() to the C++ API (which the rest of this
file makes use of anyway so there is little benefit from using the C
API), what should get rid of an amount of boilerplate and fix a leak
of the TargetMachine object in the error path.

v2: Additional fixes for LLVM 3.6.
v3: Update for the latest LLVM SVN changes.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/compat.hpp
lvm/invocation.cpp
lvm/util.hpp
7bcefa59031992a39ac997c2000dbad26153aed2 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Clean up ELF parsing.

This function was doing three separate things:
- Initializing and releasing the ELF parsing state (the latter can be
better done using RAII).
- Searching for the symbol table in the ELF file.
- Extraction of kernel symbol offsets from the symbol table.

Split each one into a separate function for clarity and clean up the
result slightly.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
574477e5994166ce6212e922ff15d6a36f840bf3 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Move a bunch of utility functions into separate file.

Some of these will be useful from a different compilation unit in the
same subtree so put them in a publicly accessible header file.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
akefile.sources
lvm/invocation.cpp
lvm/util.hpp
92247cef3f5d88f17986de8677df5ed4931b6769 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Tidy debug handling.

Most significant change is debugging flags are now a scoped enum and
all debugging helpers live in the debug namespace.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
4614397ac2689b0424cf047577316b644c407f6e 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Use helper function to abort compilation with error message.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
423eecb76a24e014198ab2281805e60d76d8f1ae 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Simplify diagnostic_handler().

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
5884dfbc2a39adbbcc8ef7e7b53d4299ba2616ff 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Trivial codestyle clean-up for optimize().

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
bdc27f13d53759ce9c1c7f58e62a259a18b2ca33 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Clean up compilation into LLVM IR.

Some assorted and mostly trivial clean-ups for the source to bitcode
compilation path.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
714b167f5705a5eec29b2b83dac0d61c5d5746f2 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Factor out LLVM context init.

So it can be shared between the compilation and linking codepaths.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
fa94055d534b2c2237cfb775066b5a4835dd0849 28-Jun-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Declare compiler instance at top level and pass down as argument.

This allows simplifying the interface of compile_llvm() because it no
longer needs to read out and return the optimization level and address
space map from the compiler instance. Instead declare the compiler
instance at the top level so that both properties are available
directly.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
a27d4ec3b9658c76e6caf19dd9024d901e543a7f 26-Jun-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Refactor compiler instance initialization.

This will be shared between the compiler and linker codepaths.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
c2a167ad73f91f4e9f94a45aba65a01e198fd41f 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Factor out compiler option tokenization.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
c513cfa747bdb9ac3059ab4e436cd7083c50aed0 26-Jun-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Factor out target string parsing.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
251054220eeaf23f20e0f8447071a22b11225ac6 26-Jun-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Collect #ifdef mess into a separate file.

This gets rid of most ifdef's from the invocation.cpp code -- Only a
couple of them are left which will be removed differently in the
following commits.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
akefile.sources
lvm/compat.hpp
lvm/invocation.cpp
11afde89b82174c499007b79152a38fd61839c57 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Drop dead code.

This ifdef'ed out code was meant to handle compilation into TGSI, but
it doesn't seem likely that it will ever be useful even if the TGSI
back-end is resurrected because the TGSI bitcode can just be plumbed
through in ELF format and dealt with as a regular "native" back-end.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
600ac51448f0dc62808e962a206d11e1b179a32f 28-Jun-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Drop support for LLVM < 3.6.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
2909e292fc53490d0bc6d433a5ecc1e51e18c34b 07-Jul-2016 Nicolai Hähnle <nicolai.haehnle@amd.com> gallium: add async flag to pipe_debug_callback

v2: fix typo db -> cb

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
ore/queue.cpp
f98530b73960af1cb17da80159350fbe51352fea 21-Jun-2016 Emil Velikov <emil.velikov@collabora.com> clover: conditionally use MESA_GIT_SHA1

Considering how hard/annoying it was for many peoples' workflow to
properly generate the macro, it will be demoted to conditionally
available with follow-up commits.

v2: Kill off gracious blank line (Vedran).

Cc: mesa-stable@lists.freedesktop.org
Cc: Vedran Miletić <vedran@miletic.net>
Cc: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (v1)
Reviewed-by: Vedran Miletić <vedran@miletic.net>
pi/device.cpp
pi/platform.cpp
ef8e50a841e79597ca56ae081102119329fd154c 22-Apr-2016 Hans de Goede <hdegoede@redhat.com> clover: Pass work_dim parameter of clEnqueueNDRangeKernel() to driver

In order to implement get_work_dim() the driver may need to know the
clEnqueueNDRangeKernel() work_dim parameter, so pass it to the driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
ore/kernel.cpp
87787e907929fe65d6b65d467ad05ea94279bb5a 23-Jun-2016 Jan Vesely <jan.vesely@rutgers.edu> clover: Fix kernel metadata retrieval after clang r273425

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Acked-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
a8a966ddb5ad805421bb9548b150055d14fb5c63 17-May-2016 Francisco Jerez <currojerez@riseup.net> clover/llvm: Fix copyright attribution of invocation.cpp.

This file still only has my name on the copyright notice even though
most of the code (likely more than 90% of it) was authored by various
contributors -- It doesn't seem right to have the whole file
attributed to myself.

Acked-by: Michel Dänzer <michel.daenzer@amd.com>
Acked-by: Serge Martin <edb+mesa@sigluy.net>
lvm/invocation.cpp
82e0bbd01abfb2073519941d9893fa6ac05fb58c 21-Jun-2016 Vedran Miletić <vedran@miletic.net> clover: Fix build against clang SVN >= r273191

setLangDefaults() now requires PreprocessorOptions as an argument.

Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
lvm/invocation.cpp
fafe026dbe0680c971bf3ba2452954eea84287f2 14-Jun-2016 Aaron Watry <awatry@gmail.com> clover: Include generated sources in AM_CPPFLAGS

git_sha1.c is generated in $(top_builddir)/src.

Fixes out-of-tree builds since 4825264f75c83576.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96516
Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
akefile.am
4825264f75c83576f251290547f121f066b46a70 06-Jun-2016 Vedran Miletić <vedran@miletic.net> clover: Update OpenCL version string to match OpenGL

Change MESA into Mesa in CL_PLATFORM_VERSION and CL_DEVICE_VERSION. For
both, always append git version suffix from git_sha1.h.

v5: move semicolon to same line as MESA_GIT_SHA1.
v4: drop #ifdef guards.
v3: add missing include.
v2: change CL_DEVICE_VERSION as well.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/device.cpp
pi/platform.cpp
47b390fe45e5e6f982c60b58985892438959cd8e 17-May-2016 Jan Vesely <jano.vesely@gmail.com> Treewide: Remove Elements() macro

Signed-off-by: Jan Vesely <jano.vesely@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
gsi/compiler.cpp
40c6d54e76c5e5859a78841ed305935b2ca6922c 16-May-2016 Jan Vesely <jan.vesely@rutgers.edu> clover: grid_offset should be padded with 0 not 1

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/kernel.cpp
9525f33164fcc071088093d110404b6c3b9d5ab8 12-May-2016 Jan Vesely <jan.vesely@rutgers.edu> clover: Handle PIPE_SHADER_IR_NIR in switch

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
860210ccfc0a90a4635fc930cd323bc426db5991 27-Apr-2016 Michel Dänzer <michel.daenzer@amd.com> clover: Fix build against clang SVN >= r267772

(Re-pushing previous fix for clang SVN r265359, which was reverted in
the meantime)

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
lvm/invocation.cpp
171a570f388b2895d14f6d5418c99573cffd6369 13-Apr-2016 Michel Dänzer <michel.daenzer@amd.com> clover: Fix build against LLVM SVN >= r266163

createInternalizePass now takes a callback instead of a StringSet.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
715e97e3421ec33c219c9829e7930d135dfe0bf8 07-Apr-2016 Michel Dänzer <michel.daenzer@amd.com> Revert "clover: Fix build against clang SVN >= r265359"

This reverts commit 0daab9878d2b96356cf667591a2c877d912be52d.

The corresponding clang change was reverted.

Trivial.
lvm/invocation.cpp
0daab9878d2b96356cf667591a2c877d912be52d 05-Apr-2016 Michel Dänzer <michel.daenzer@amd.com> clover: Fix build against clang SVN >= r265359

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
lvm/invocation.cpp
1a5c8c24b5791efa02a7beefa4ba1c49ae033c73 25-Mar-2016 Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> gallium: distinguish between shader IR in get_compute_param

For radeonsi, native and TGSI use different compilers and this results
in different limits for different IR's.

The set we strictly need for radeonsi is only the MAX_BLOCK_SIZE
and MAX_THREADS_PER_BLOCK params, but I added a few others as shader
related that seemed like they would also typically depend on the
compiler.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Dave Airlie <airlied@redhat.com>
ore/device.cpp
be5899dcf9a337548d8095a00060d4451b0df222 24-Mar-2016 Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> gallium: add global buffer memory barrier bit

Currently radeonsi synchronizes after every dispatch and Clover
does nothing to synchronize. This is overzealous, especially with
GL compute, so add a barrier for global buffers.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Dave Airlie <airlied@redhat.com>
ore/kernel.cpp
ea8f4a6b13b94eb060bff4ccc6c13efc01d2b682 17-Mar-2016 Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> gallium: add compute shader IR type

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
ore/kernel.cpp
4d02e91e4938c98bcf9d4e57ab2e5463bb42e836 14-Mar-2016 Hans de Goede <hdegoede@redhat.com> clover: Fix pipe_grid_info.indirect not being initialized.

After pipe_grid_info.indirect was introduced, clover was not modified
to set it causing it to pass uninitialized memory for it to launch_grid.

This commit fixes this by zero-ing the entire pipe_grid_info struct when
declaring it, to avoid similar problems popping-up in the future.

Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
[ Francisco Jerez: Trivial codestyle fix. ]
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/kernel.cpp
04bc09fdf9e353fbb1303635236da551785373c9 28-Dec-2015 Koop Mast <kwm@rainbow-runner.nl> st/clover: Add libelf cflags to the build

Otherwise the build will fail, when the library is in a non default
location.

v2 [Emil Velikov]
- drop the unneeded cflags from targets/opencl.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Fixes: 7f585a6a98d "configure.ac: use pkg-config for libelf"
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93524
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
akefile.am
a4cff1859efedac37368c1ddc55b091b6cd3eb65 13-Feb-2016 Serge Martin <edb+mesa@sigluy.net> clover: fix build failure since bfd695e

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/kernel.cpp
bfd695e1d2975e5dd5363c2e7fcc3084a28457aa 12-Jan-2016 Samuel Pitoiset <samuel.pitoiset@gmail.com> gallium: add a new interface for pipe_context::launch_grid()

This introduces pipe_grid_info which contains all information to
describe a launch_grid call. This will be used to implement indirect
compute in the same fashion as indirect draw.

Changes from v2:
- correctly initialize pipe_grid_info for nv50/nvc0

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
ore/kernel.cpp
b4a03e7f8f4006eb2c5b09a0611fdda153dd8437 09-Dec-2015 Michel Dänzer <michel.daenzer@amd.com> clover: Fix build against LLVM 3.8 SVN >= r255078

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
9adbb9e7134fdc40766710592e81cbc9c09c7aaa 28-Nov-2015 Tom Stellard <thomas.stellard@amd.com> clover: Handle NULL devices returned by pipe_loader_probe() v2

When probing for devices, clover will call pipe_loader_probe() twice.
The first time to retrieve the number of devices, and then second time
to retrieve the device structures.

We currently assume that the return value of both calls will be the
same, but this will not be the case if a device happens to disappear
between the two calls.

When a device disappears, the pipe_loader_probe() will add a NULL
device to the device list, so we need to handle this.

v2:
- Keep range for loop

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>

CC: <mesa-stable@lists.freedesktop.org>
ore/platform.cpp
b7c958b7b7c44e8f4c6dc0190e4c198722e020e5 26-Oct-2015 Serge Martin <edb+mesa@sigluy.net> clover: fix tgsi compiler crash with invalid src

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
gsi/compiler.cpp
74d41a32bc179425e866f8afa33a222488ea7760 14-Oct-2015 Emil Velikov <emil.l.velikov@gmail.com> gallium: remove library_path argument from pipe_loader_create_screen()

Currently the location is determined at configure/build time and
consistently copied across gallium. Just remove the extra argument, and
use PIPE_SEARCH_DIR where appropriate.

This will allow us to remove the duplication in the *configuration and
*screen_create APIs by moving util_dl_get_proc_address() and friends to
probe time.

v2: rebase on top of vl_winsys_drm.c addition

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Rob Clark <robclark@freedesktop.org>
akefile.am
ore/device.cpp
6bcd5f0d02fff2db0c330af7d139d7a60b59e0e2 14-Oct-2015 Emil Velikov <emil.l.velikov@gmail.com> automake: use GALLIUM_PIPE_LOADER_DEFINES only where applicable

As of last commit we no longer need the defines in order to have the
function prototypes.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Rob Clark <robclark@freedesktop.org>
akefile.am
6706cc1671bfd8e6c021db8b68815959fa7fceba 31-Oct-2015 Ilia Mirkin <imirkin@alum.mit.edu> st/clover: provide a path for drivers to call through to pfn_notify

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>

[ Francisco Jerez: Clean up clover::context interface by passing
around a function object. ]
pi/context.cpp
ore/context.cpp
ore/context.hpp
ore/queue.cpp
37402014e80f991169f9e05c1520667ba3930baf 28-Oct-2015 Laurent Carlier <lordheavym@gmail.com> clover: fix building fix clang-3.8

https://bugs.freedesktop.org/show_bug.cgi?id=92705

v2.1: use Linker::Flags::None instead of 0 and emplace_back()

Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
2518645f63e2f66d3638180f44a007541928319c 19-Sep-2015 Serge Martin <edb+mesa@sigluy.net> clover: Implement clCreateImage?D w/ clCreateImage.

Remplace clCreateImage2D and clCreateImage3D implementation with call
to clCreateImage.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/memory.cpp
f2c52e392bdaa9ce9b9075996eb5efafde142030 19-Sep-2015 Serge Martin <edb+mesa@sigluy.net> clover: Implement CL1.2 clCreateImage().

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/memory.cpp
92666b90c0db8bb51fd54bcf22db3d288a5556e7 18-Sep-2015 Francisco Jerez <currojerez@riseup.net> clover: Move down canonicalization of memory object flags into validate_flags().

This will be used to share the same logic between buffer and image
creation.

v2: Make memory flag set constants local to validate_flags. (Serge
Martin)
pi/memory.cpp
1691ead1b8ae4018a805af58977a43ef90af4203 08-Sep-2015 Albert Freeman <albertwdfreeman@gmail.com> clover: Avoid using typename to allow compilation of clover by clang

When parsing an variable declaration qualified with the typename
keyword, clang attempted to declare a variable with the type of non
type member "enum type type" of module::argument (within the header
file clover/core/module.hpp) instead of the typed member of
module::argument "enum type".

Replaced "typename" with "enum" to force clang to declare the variable
marg_type with type "enum type" of module::argument.

CC: "11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Albert Freeman <albertwdfreeman@gmail.com>
lvm/invocation.cpp
0fc21ecfc0891d239f20bf7724e51bc75503570c 25-Jul-2015 Marek Olšák <marek.olsak@amd.com> gallium: add flags parameter to pipe_screen::context_create

This allows creating compute-only and debug contexts.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
ore/queue.cpp
df5cdec1329507d5ac52a6d3db49c2608b9226bc 19-Aug-2015 Zoltan Gilian <zoltan.gilian@gmail.com> clover: fix llvm 3.5 build error

There is no MDOperand in llvm 3.5.

v2: Check if kernel metadata is present to avoid crash (EdB).
v3: Second attempt to avoid crash: switch off metadata query for llvm < 3.6.

Reviewed-by: Serge Martin (EdB) <edb+mesa@sigluy.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
7f4ad692a10bf0f247dedd4968b7ffe9b07d2af2 14-Aug-2015 Michel Dänzer <michel.daenzer@amd.com> st/clover: Fix build against LLVM 3.8 SVN r244928

raw_svector_ostream::flush() is now unnecessary and forbidden:

CXX llvm/libclllvm_la-invocation.lo
../../../../../src/gallium/state_trackers/clover/llvm/invocation.cpp: In function 'clover::module {anonymous}::build_module_llvm(llvm::Module*, unsigned int (&)[7])':
../../../../../src/gallium/state_trackers/clover/llvm/invocation.cpp:574:29: error: use of deleted function 'void llvm::raw_svector_ostream::flush()'
bitcode_ostream.flush();
^
In file included from /home/daenzer/src/llvm-git/llvm/include/clang/Basic/VirtualFileSystem.h:22:0,
from /home/daenzer/src/llvm-git/llvm/include/clang/Basic/FileManager.h:20,
from /home/daenzer/src/llvm-git/llvm/include/clang/Basic/SourceManager.h:38,
from /home/daenzer/src/llvm-git/llvm/include/clang/Frontend/CompilerInstance.h:16,
from ../../../../../src/gallium/state_trackers/clover/llvm/invocation.cpp:25:
/home/daenzer/src/llvm-git/llvm/include/llvm/Support/raw_ostream.h:512:8: note: declared here
void flush() = delete;
^
Makefile:862: recipe for target 'llvm/libclllvm_la-invocation.lo' failed

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
a97f1b697b01dca9f72d8559f8269188d76dccc9 07-Aug-2015 Serge Martin (EdB) <edb+mesa@sigluy.net> clover: Stub missing CL 1.2 functions.

As sugested by Tom a long time ago
and in order to be able to create Piglit tests

v2:
replace NOT_SUPPORTED_BY_CL_1_1 macro with an inline function
remove extra space in clLinkProgram arg

v3:
use __func__

v4:
back to a macro, it make more sense to use it with __func__

[ Francisco Jerez: Rename to CLOVER_NOT_SUPPORTED_UNTIL and pass the
minimum API version required by the entry point so the error
messages don't become stale when support for additional CL versions
is introduced. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/dispatch.cpp
pi/kernel.cpp
pi/memory.cpp
pi/program.cpp
pi/transfer.cpp
pi/util.hpp
be3622dce383cb930a233b88bb056adb026dce1f 30-Jul-2015 Zoltan Gilian <zoltan.gilian@gmail.com> clover: handle setKernelArg errors
ore/kernel.cpp
aa46fba7e61a77bb3b029c7a483b5a2a2a73ff4d 27-Jul-2015 Zoltan Gilian <zoltan.gilian@gmail.com> clover: fix image resource depth and array_size
ore/memory.cpp
ore/resource.cpp
9ef5b7a23348291893a6bf61fcce7a306e787add 27-Jul-2015 Zoltan Gilian <zoltan.gilian@gmail.com> clover: pass image attributes to the kernel

Read-only and write-only image arguments are recognized and
distinguished.
Attributes of the image arguments are passed to the kernel as implicit
arguments.
ore/kernel.cpp
ore/kernel.hpp
ore/module.hpp
lvm/invocation.cpp
d2cd2c69b20fcb3f1fc3b7671745c5c84ef200cb 27-Jul-2015 Zoltan Gilian <zoltan.gilian@gmail.com> clover: move find_kernels to functions
lvm/invocation.cpp
a40179f47ba11e78097ae1a839df6f3911a6749f 31-Jul-2015 EdB <edb+mesa@sigluy.net> clover: make dispatch matches functions def

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/dispatch.hpp
b73bec0ecd43861337daf9663e242d2b44f36dbd 05-Jul-2015 Marek Olšák <marek.olsak@amd.com> gallium: add new limits for shader buffers and images

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
ore/device.cpp
7e0180d57d330bd8d3047e841086712376b2a1cc 07-Jul-2015 EdB <edb+mesa@sigluy.net> clover: little OpenCL status code logging clean

s/build_error/compile_error in order to match the stored OpenCL status code.
Make program::build catch and log every OpenCL error.
Make tgsi error triggering uniform with the llvm one.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/compiler.hpp
ore/error.hpp
ore/program.cpp
lvm/invocation.cpp
gsi/compiler.cpp
bd214f030f1cb102a7fe41f40f140d4de2b304c0 26-Jun-2015 Marek Olšák <marek.olsak@amd.com> gallium: use fence_finish instead of fence_signalled in state trackers

Reviewed-by: Brian Paul <brianp@vmware.com>
ore/event.cpp
d15b32ebded278243eb648bb9ecd4c5f5d6d0569 28-May-2015 Grigori Goronzy <greg@chown.ath.cx> clover: implement CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE

Work-group size should always be aligned to subgroup size; this is a
basic requirement, otherwise some work-items will be no-operation.

It might make sense to refine the value according to a kernel's
resource usage, but that's a possible optimization for the future.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/kernel.cpp
ore/device.cpp
ore/device.hpp
404a90b82786080564fe32716f83ce055b9a934f 11-Jun-2015 Matt Turner <mattst88@gmail.com> mesa: Enable subdir-objects globally.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
akefile.am
6acb61fc9c2c5f81569d17d90a480abc48ec6055 12-May-2015 Marek Olšák <marek.olsak@amd.com> clover: clarify and fix the EGL interop error case

Cc: 10.6 <mesa-stable@lists.freedesktop.org>
pi/interop.cpp
40665362fd660a8d58f9edbdfec79a33d44b1534 11-May-2015 EdB <edb+mesa@sigluy.net> clover: Log build options when dumping clc source.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
967825d053f71c5f5fc3ba31eabc0c6004fde4f1 26-May-2015 Koop Mast <kwm@rainbow-runner.nl> clover: Build fix for FreeBSD.

Cc: 10.6 10.5 <mesa-stable@lists.freedesktop.org>
ore/error.hpp
f972b223c4cb4ec58a9451cbac5d120ac9deb336 19-May-2015 Grigori Goronzy <greg@chown.ath.cx> clover: try userptr for CL_MEM_USE_HOST_PTR

According to spec, CL_MEM_USE_HOST_PTR should directly use host memory,
if possible. This is just what userptr is for, so use it.

In case the memory cannot be mapped, a fallback similar to
CL_MEM_COPY_HOST_PTR is used.

v2: constify, drop unneeded cast

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/memory.cpp
ore/resource.cpp
5c495e86388b55af067677e8608eb124a5d70d29 12-May-2015 Grigori Goronzy <greg@chown.ath.cx> clover: implement CL_MEM_ALLOC_HOST_PTR

This flag is typically used to request pinned host memory, to avoid
any copies between GPU and CPU.

This improves throughput with an older OpenCL app which I unfortunately
can't publish due to its licensing.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/resource.cpp
a533d4edf1ea346dd9e343c71b2cd500fa550ef8 09-May-2015 Francisco Jerez <currojerez@riseup.net> clover: Implement locking of the wait_count, _chain and _status members of event.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
CC: 10.5 <mesa-stable@lists.freedesktop.org>
ore/event.cpp
4022a468b2976c65e0d2afe9c9ac5804729e8641 09-May-2015 Francisco Jerez <currojerez@riseup.net> clover: Wrap event::_status in a method to prevent unlocked access.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
CC: 10.5 <mesa-stable@lists.freedesktop.org>
ore/event.cpp
ore/event.hpp
2232b929fd9ca6f00c8dab9dc45c386986be922d 09-May-2015 Francisco Jerez <currojerez@riseup.net> clover: Refactor event::trigger and ::abort to prevent deadlock and reentrancy issues.

Refactor ::trigger and ::abort to split out the operations that access
concurrently modified data members and require locking from the
recursive and possibly re-entrant part of these methods. This will
avoid some deadlock situations when locking is implemented.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
CC: 10.5 <mesa-stable@lists.freedesktop.org>
ore/event.cpp
ore/event.hpp
9c4dc98b298c74015f2a7c21571bccf0a5b6cc98 26-Mar-2015 Tom Stellard <thomas.stellard@amd.com> clover: Fix a bug with multi-threaded events v2

It was possible for some events never to get triggered if one thread
was creating events and another threads was waiting for them.

This patch consolidates soft_event::wait() and hard_event::wait()
into event::wait() so that hard_event objects will now wait for
all their dependencies to be submitted before flushing the command
queue.

v2:
- Rename variables
- Use mutable varibales so we can keep event::wait() const
- Open code signalled() call so mutex can be atted to signalled
without deadlocking.

CC: 10.5 <mesa-stable@lists.freedesktop.org>

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/event.cpp
ore/event.hpp
f546902d9597429713c83e2caf6b69856bd7ba4d 07-May-2015 Tom Stellard <thomas.stellard@amd.com> clover: Add a mutex to guard queue::queued_events

This fixes a potential crash where on a sequence like this:

Thread 0: Check if queue is not empty.
Thread 1: Remove item from queue, making it empty.
Thread 0: Do something assuming queue is not empty.

CC: 10.5 <mesa-stable@lists.freedesktop.org>

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/queue.cpp
ore/queue.hpp
952b5e84db47be3adaf01f047efeedd26cf0d173 10-Apr-2015 Marek Olšák <marek.olsak@amd.com> gallium,clover: add OpenCL interoperability support for CL events

v2: - move interop.cpp to clover/api
- change intptr_t to void* in the interface
- add a virtual function fence() to simplify some code

v3: - use bool in the interface
v4: - enclose the last two interop functions in try..catch

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
akefile.sources
pi/interop.cpp
ore/event.hpp
d8f817ae7f4241a9ea23140805aaeb724a0ac851 23-Apr-2015 EdB <edb+mesa@sigluy.net> clover: remove util/compat

Acked-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
akefile.sources
pi/program.cpp
ore/compiler.hpp
ore/error.hpp
ore/kernel.cpp
ore/module.cpp
ore/module.hpp
ore/program.cpp
ore/program.hpp
lvm/invocation.cpp
gsi/compiler.cpp
til/compat.hpp
2d112ed96152bc62e5417472270f29966c8feece 24-Apr-2015 EdB <edb+mesa@sigluy.net> clover: make module::symbol::name a string

Acked-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
pi/program.cpp
ore/module.cpp
ore/module.hpp
5ca9b23319db66d9768d46c0a7504b7bb079164a 24-Apr-2015 EdB <edb+mesa@sigluy.net> clover: remove compat::string

Acked-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
pi/program.cpp
ore/compiler.hpp
ore/error.hpp
ore/program.cpp
lvm/invocation.cpp
gsi/compiler.cpp
til/compat.hpp
1b4a1d0049646e574565bab38b8ae935c1c45fae 24-Apr-2015 EdB <edb+mesa@sigluy.net> clover: remove compat classes that match std one

Acked-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
akefile.sources
pi/program.cpp
ore/compiler.hpp
ore/error.hpp
til/compat.cpp
til/compat.hpp
3c61ff0d89da4a8cc921d131ce0c2480ddb111a0 21-Apr-2015 EdB <edb+mesa@sigluy.net> clover: compile all sources with c++11

Later we can remove the compat code

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
akefile.am
c1485f4b7d044724b3dbc1011f3c3a8a53132010 19-Apr-2015 EdB <edb+mesa@sigluy.net> clover: remove pre llvm 3.5.0 compatibility code

Acked-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
lvm/invocation.cpp
fda7558057a301a5a0ee1cb4d68f09ea39b03bb3 24-Mar-2015 Tom Stellard <thomas.stellard@amd.com> clover: Return CL_BUILD_ERROR for CL_PROGRAM_BUILD_STATUS when compilation fails v2

v2:
- Don't use _errs map

Cc: 10.5 10.4 <mesa-stable@lists.freedesktop.org>

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/program.cpp
dfb1ae9d914b7723ef50fdd2efe811feebc045ad 20-Mar-2015 Tom Stellard <thomas.stellard@amd.com> clover: Return 0 as storage size for local kernel args that are not set v2

The storage size for local kernel args can be queried before the
arguments are set by using the CL_KERNEL_LOCAL_MEM_SIZE param
of clGetKernelWorkGroupInfo().

The spec says that if local kernel arguments have not been specified,
then we should assume their size is 0.

v2:
- Implement using c++11 member initialization.

Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>

Cc: 10.5 10.4 <mesa-stable@lists.freedesktop.org>
ore/kernel.hpp
7932b30892ef898ec4c74ac1f972cb462f19962b 22-Mar-2015 Giuseppe Bilotta <giuseppe.bilotta@gmail.com> clover: use get_device_vendor instead of get_vendor

The pipe's get_vendor method returns something more akin to a driver
vendor string in most cases, instead of the actual device vendor. Use
get_device_vendor instead, which was introduced specifically for this
purpose.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/device.cpp
6e17936bf84c286c3540fe559838bc2a4d975539 21-Mar-2015 Tom Stellard <thomas.stellard@amd.com> clover: The unit for CL_DEVICE_MEM_BASE_ADDR_ALIGN is bits not bytes

Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/device.cpp
2b12b1752ae18c468cb01e94c78544ca5783dc44 21-Mar-2015 Tom Stellard <thomas.stellard@amd.com> clover: Add all the mandatory 1.1 extensions to the extension string

Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/device.cpp
96f9cc9181403a93208cb44786c485ce44492eda 21-Mar-2015 Tom Stellard <thomas.stellard@amd.com> clover: Add a space at the end of CL_DEVICE_OPENCL_C_VERSION

This is required by the spec.

Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/device.cpp
a646b00cfc42fecdf4f853a6fe3ddf12d7801881 05-Mar-2015 Tom Stellard <thomas.stellard@amd.com> clover: Return the minimum required value for CL_DEVICE_SINGLE_FP_CONFIG v2

This means dropping CL_FP_DENORM from the current return value.

v2:
- Add comments about minimum values for OpenCL 1.2.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
pi/device.cpp
c97e902a1a69892147e7649581951747f03afaee 02-Jul-2014 Tom Stellard <thomas.stellard@amd.com> clover: Enable cl_khr_fp64 for devices that support doubles v4

v2:
- Report correct values for CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE
and CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE.
- Only define cl_khr_fp64 if the extension is supported.
- Remove trailing space from extension string.
- Rename device query function from cl_khr_fp64() to
has_doubles().

v3:
- Return 0 for device::doubled_fp_confg() when doubles aren't
supported.

v4:
- Remove device query for double fp_config.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/device.cpp
ore/device.cpp
ore/device.hpp
a398168f7238b42c2fbecf940e09fc5ebef71f62 04-Mar-2015 Tom Stellard <thomas.stellard@amd.com> clover: Fix build since llvm r231270
lvm/invocation.cpp
75514555aa0061299034bf15b5df31ab6746c0e5 27-Feb-2015 Tom Stellard <thomas.stellard@amd.com> clover: Don't unconditionally define cl_khr_fp64

This should be done by the frontend for devices that support this
extension.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
f8f3aa78d8846174d3b5a877b3c06ee7bdbb29c7 22-Feb-2015 Francisco Jerez <currojerez@riseup.net> clover: Set appropriate flag defaults on memory object creation.

According to the spec when no device access mode is specified
clCreateBuffer and clCreateImage* should default to read/write, and
clCreateSubBuffer should default to the parent's device access flags.

clCreateSubBuffer is also required to inherit the host access and
host pointer flags from the parent.

Reviewed-and-tested-by: EdB <edb+mesa@sigluy.net>
pi/memory.cpp
0e8460a52882ec58743991fec431f85300bea209 22-Feb-2015 EdB <edb+mesa@sigluy.net> clover: Add CL_MEM_HOST_* flag checks.

Those flags have been introduced in OpenCL 1.2.

[ Francisco Jerez: Rebase. Throw CL_INVALID_VALUE from
clCreateSubBuffer if the subbuffer drops access flags from its
parent. Use single function taking the set of allowed host access
flags to validate memory transfer operands. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/memory.cpp
pi/transfer.cpp
80d3c1e5372d56a55701b10b937173c27615e4b0 22-Feb-2015 Francisco Jerez <currojerez@riseup.net> clover: Factor out memory object flags validation to a helper function.

And define constants for commonly used subsets of flags to save some
typing.

Reviewed-and-tested-by: EdB <edb+mesa@sigluy.net>
pi/memory.cpp
7df256add2ae9fb916c3e0f80c879e42d1c8a7a0 14-Feb-2015 Shawn Starr <shawn.starr@rogers.com> clover: Use Legacy PassManager for LLVM trunk (3.7)

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Shawn Starr <shawn.starr@rogers.com>
lvm/invocation.cpp
6ee5effac1ac8858c96820ece352be57c5c53cf6 28-Jan-2015 EdB <edb+mesa@sigluy.net> clover/llvm: Dump the OpenCL C code earlier.

[ Francisco Jerez: As discussed on the mailing list, this is intended
to produce more useful debug output in cases where the compilation
terminates unexpectedly. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
13d23a9a176b62453d36035b5d793082a638a686 14-Dec-2014 EdB <edb+mesa@sigluy.net> clover/llvm: Move CLOVER_DEBUG stuff into anonymous namespace.

[ Francisco Jerez: As we're at it make debug_options[] local to its
only user and remove temporary. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
5c83a0d2ce41fa4b7b39d13c69d39990f7c926f5 21-Jan-2015 Michel Dänzer <michel.daenzer@amd.com> st/clover: Pass target instead of target.begin() to std::string()

Fixes reading beyond allocated memory:

==1936== Invalid read of size 1
==1936== at 0x4C2C1B4: strlen (vg_replace_strmem.c:412)
==1936== by 0x9E00C30: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20)
==1936== by 0x5B44FAE: clover::compile_program_llvm(clover::compat::string const&, clover::compat::vector<clover::compat::pair<clover::compat::string, clover::compat::string> > const&, pipe_shader_ir, clover::compat::string const&, clover::compat::string const&, clover::compat::string&) (invocation.cpp:698)
==1936== by 0x5B39A20: clover::program::build(clover::ref_vector<clover::device> const&, char const*, clover::compat::vector<clover::compat::pair<clover::compat::string, clover::compat::string> > const&) (program.cpp:63)
==1936== by 0x5B20152: clBuildProgram (program.cpp:182)
==1936== by 0x400F41: main (hello_world.c:109)
==1936== Address 0x56fee1f is 0 bytes after a block of size 15 alloc'd
==1936== at 0x4C28C20: malloc (vg_replace_malloc.c:296)
==1936== by 0x5B398F0: alloc (compat.hpp:59)
==1936== by 0x5B398F0: vector<std::basic_string<char> > (compat.hpp:98)
==1936== by 0x5B398F0: string<std::basic_string<char> > (compat.hpp:327)
==1936== by 0x5B398F0: clover::program::build(clover::ref_vector<clover::device> const&, char const*, clover::compat::vector<clover::compat::pair<clover::compat::string, clover::compat::string> > const&) (program.cpp:63)
==1936== by 0x5B20152: clBuildProgram (program.cpp:182)
==1936== by 0x400F41: main (hello_world.c:109)

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
9cbb9165b9454ccc7f2a6702ce71bc5cd9faba02 25-Jan-2015 Jan Vesely <jan.vesely@rutgers.edu> clover: Fix build with llvm after r226981

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88783
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
a6a75f1286e1a2e7a0fb856849802b40474c6336 14-Jan-2015 Michel Dänzer <michel.daenzer@amd.com> st/clover: Adapt to TargetLibraryInfo.h move in LLVM SVN r226078

Trivial.
lvm/invocation.cpp
3a18fc60581ad27811b0b4b22fce51da0ae8a008 06-Dec-2014 Jan Vesely <jan.vesely@rutgers.edu> clover: Use switch when creating kernel arguments.

This way we get a warning if an enum value is not handled.

v2: codestyle

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/kernel.cpp
25db8729dc53b60ee0caade5e797e99d6ad13fa3 10-Dec-2014 Aaron Watry <awatry@gmail.com> clover: Fix build after llvm r223802

Signed-off-by: Aaron Watry <awatry at gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
lvm/invocation.cpp
745b1f550339b3adbf272a28b9d0c767a86ff2fb 07-Nov-2014 EdB <edb+mesa@sigluy.net> clover: clCompileProgram CL_INVALID_COMPILER_OPTIONS

clCompileProgram should return CL_INVALID_COMPILER_OPTIONS
instead of CL_INVALID_BUILD_OPTIONS

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/program.cpp
lvm/invocation.cpp
0cae7ea2719a939cf91de03a1bfeeeca08ec98a4 12-Nov-2014 Tom Stellard <thomas.stellard@amd.com> Revert "clover: Fix build after llvm r221375"

This reverts commit cd93d82ba9ec8cd8e4f54bbee16d7b47c542de71.

llvm r221375 was reverted, so this commit needs to be too.
lvm/invocation.cpp
cd93d82ba9ec8cd8e4f54bbee16d7b47c542de71 06-Nov-2014 Jan Vesely <jan.vesely@rutgers.edu> clover: Fix build after llvm r221375

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
lvm/invocation.cpp
263eb7fa39a16bcce7d64a4b8343c6adbc3e916c 03-Nov-2014 Tom Stellard <thomas.stellard@amd.com> clover: Fix clBuildProgram piglit regression

Should trigger CL_INVALID_VALUE if device_list is NULL and num_devices
is greater than zero.

Introduced by e5468dfa523be2a7a0d04bb9efcf8ae780957563

Reported by: EdB

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/program.cpp
64b0fac5e25370224b383c748f1a56b4ef1eb2d6 21-Oct-2014 Tom Stellard <thomas.stellard@amd.com> clover: Fix bug when binary programs are passed to clBuildProgram() v2

This was a regression introduced by
611d66fe4513e53bde052dd2bab95d448c909a2a

Passing a binary program to clBuildProgram() is legal, but passing one
to clCompileProgram() is not.

v2:
- Code cleanups.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/program.cpp
ore/program.hpp
e5468dfa523be2a7a0d04bb9efcf8ae780957563 21-Oct-2014 Tom Stellard <thomas.stellard@amd.com> clover: Factor input validation of clCompileProgram into a new function v2

This factors out the validation that is common with clBuildProgram().

v2:
- Code cleanups.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/program.cpp
b4039cf15a5f374add7846a966bb2ef4e738adab 20-Oct-2014 Emil Velikov <emil.l.velikov@gmail.com> clover: use correct typenames for compat::pair's first/second

Seems to be a typo judging from the overall declaration of the
template.

Cc: EdB <edb+mesa@sigluy.net>
Cc: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
til/compat.hpp
013ff2fae13da41c2f5619c4698b0a7b5aa6a06d 22-Oct-2014 José Fonseca <jfonseca@vmware.com> gallivm,llvmpipe,clover: Bump required LLVM version to 3.3.

We'll need to update gallivm for the interface changes in LLVM 3.6, and
the fewer the number of older LLVM versions we support the less hairy that
will be.

As consequence HAVE_AVX define can disappear. (Note HAVE_AVX meant
whether LLVM version supports AVX or not. Runtime support for AVX is
always checked and enforced independently.)

Verified llvmpipe builds and runs with with LLVM 3.3, 3.4, and 3.5.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
lvm/invocation.cpp
1ab6543431b5a4eaf589cdabf2227088dd62ce6f 19-Oct-2014 Vinson Lee <vlee@freedesktop.org> clover: Fix build error with LLVM 3.4.

DataLayoutPass was added in LLVM 3.5 r202168, commit
57edc9d4ff1648568a5dd7e9958649065b260dca "Make DataLayout a plain
object, not a pass.".

This patch fixes this build error with LLVM 3.4.

CXX llvm/libclllvm_la-invocation.lo
llvm/invocation.cpp: In function 'void {anonymous}::optimize(llvm::Module*, unsigned int, const std::vector<llvm::Function*>&)':
llvm/invocation.cpp:324:18: error: expected type-specifier
PM.add(new llvm::DataLayoutPass(mod));
^

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85189
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
lvm/invocation.cpp
01d94193ac34239cc96e3f4aab7df0e37a82eb31 11-Oct-2014 EdB <edb+mesa@sigluy.net> clover: Don't return CL_INVALID_VALUE if there is no header.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/program.cpp
aa93af809fc8268a8a4a80e00ff4b8a2770fa659 12-Oct-2014 EdB <edb+mesa@sigluy.net> clover: Add allow_empty_tag.

To allow empty objs() list checks.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/object.hpp
611d66fe4513e53bde052dd2bab95d448c909a2a 20-Oct-2014 EdB <edb+mesa@sigluy.net> clover: Add initial implementation of clCompileProgram for CL 1.2.

[ Francisco Jerez: General clean-up. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/dispatch.cpp
pi/program.cpp
ore/compiler.hpp
ore/error.hpp
ore/program.cpp
ore/program.hpp
lvm/invocation.cpp
fead2b04632eb4e1e50f1fb08be5d2c033457840 09-Oct-2014 EdB <edb+mesa@sigluy.net> clover: Add a simple compat::pair.

std::pair is not c++98/c++11 safe.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
til/compat.hpp
5583459655d61c9619284987e0272417db5daab3 09-Oct-2014 Francisco Jerez <currojerez@riseup.net> clover/util: Allow using key_equals with pair-like objects other than std::pair.
til/functional.hpp
e987fd5dc6bf8cd161e442c8e6231f0334e12dbf 09-Oct-2014 Francisco Jerez <currojerez@riseup.net> clover/util: Define equality operators for a couple of compat classes.
til/compat.hpp
1441a3c1bba542f318cfc0f4468ef34f97121a1d 08-Oct-2014 Francisco Jerez <currojerez@riseup.net> clover/util: Fix construction of compat::vector with a general container as argument.
til/compat.hpp
e1d363b3ffbfb85133a6871c63068a4ba841b2cd 30-Sep-2014 Tom Stellard <thomas.stellard@amd.com> clover: Add environment variables for dumping kernel code v2

There are two debug variables:

CLOVER_DEBUG which you can set to any combination of llvm,clc,asm
(separated by commas) to dump llvm IR, OpenCL C, and native assembly.

CLOVER_DEBUG_FILE which you can set to a file name for dumping output
instead of stderr. If you set this variable, the output will be split
into three separate files with different suffixes: .cl for OpenCL C,
.ll for LLVM IR, and .asm for native assembly. Note that when data
is written, it is always appended to the files.

v2:
- Code cleanups
- Add CLOVER_DEBUG_FILE environment variable for dumping to a file.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
76136c29bbd78ea414c86402d4031855218dc42b 26-Sep-2014 Tom Stellard <thomas.stellard@amd.com> clover: Register an llvm diagnostic handler v3

This will allow us to handle internal compiler errors.

v2:
- Code cleanups.

v3:
- More cleanups.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
8e7df519bd8556591794b2de08a833a67e34d526 25-Sep-2014 Tom Stellard <thomas.stellard@amd.com> clover: Add support for compiling to native object code v3

v2:
- Split build_module_native() into three separate functions.
- Code cleanups.

v3:
- More cleanups.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
dc39b32c9bc967a26f745e7ebebcbc4c44c83f20 25-Sep-2014 Tom Stellard <thomas.stellard@amd.com> clover: Factor kernel argument parsing into its own function v2

v2:
- Code cleanups.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
8cf6482c3da9493dacf4a6a495ae3c0193cf75a7 14-Oct-2014 Tom Stellard <thomas.stellard@amd.com> clover: Fix regression in module serialization

We need to serialize semantic information for arguments, which was added
in 06139c56fa070f84a931a4ddbdb894c9e8d24f55.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/module.cpp
2286edce16e4f78500ccda77da99c30185d9c58f 12-Oct-2014 Francisco Jerez <currojerez@riseup.net> clover: Fix unintended fall-through in kernel::argument::bind.
ore/kernel.cpp
5bffc5e2620db7631300527f937b3a4823f3f999 08-Oct-2014 Jan Vesely <jan.vesely@rutgers.edu> clover: Append implicit arguments to the kernel argument list.

[ Francisco Jerez: Split off from a larger patch, and take a slightly
different approach for passing the implicit arguments around. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
bf89a97748748592639087e8167e29c98c740d33 08-Oct-2014 Francisco Jerez <currojerez@riseup.net> clover: Pass execution dimensions and offset to the kernel as implicit arguments.

Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
ore/kernel.cpp
ore/kernel.hpp
06139c56fa070f84a931a4ddbdb894c9e8d24f55 08-Oct-2014 Francisco Jerez <currojerez@riseup.net> clover: Add semantic information to module::argument for implicit parameter passing.

Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
ore/module.hpp
27c51b5f5864cdb69f587ff4b2ede1f69db57849 08-Oct-2014 Francisco Jerez <currojerez@riseup.net> clover: Use unreachable() from util/macros.h instead of assert(0).

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
akefile.am
ore/device.cpp
ore/object.hpp
c6d980140913307d48648058ec24da42a31fc37c 22-Sep-2014 Tom Stellard <thomas.stellard@amd.com> clover: Add support to mem objects for multiple destructor callbacks v2

The spec says that mem objects should maintain a stack of callbacks
not just one.

v2:
- Remove stray printf.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>

CC: "10.3" <mesa-stable@lists.freedesktop.org>
ore/memory.cpp
ore/memory.hpp
3d3d9c3617c3c135a11a67bf073f06933034e8ec 29-Aug-2014 Emil Velikov <emil.l.velikov@gmail.com> st/clover: ship Doxyfile in the release tarball

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
akefile.am
b4539274b6478249d52e99fa34243daacf48be80 18-Aug-2014 Francisco Jerez <currojerez@riseup.net> clover/util: Null-terminate the result of compat::string::c_str().

Reported-by: EdB <edb+mesa@sigluy.net>
til/compat.hpp
923c72982e9cdc9766e395f709aeae95e1d2424e 18-Aug-2014 Francisco Jerez <currojerez@riseup.net> clover/util: Implement compat::string using aggregation instead of inheritance.
til/compat.hpp
7c1e6d582c772753cfdbfd3d09509af608b54d91 18-Aug-2014 Francisco Jerez <currojerez@riseup.net> clover/util: Have compat::vector track separate size and capacity.

In order to make the behaviour of resize() and reserve() closer to the
standard.

Reported-by: EdB <edb+mesa@sigluy.net>
ore/module.cpp
til/compat.hpp
995f7b37dad75999ce09f29fe999a8c30e899bb0 18-Aug-2014 Francisco Jerez <currojerez@riseup.net> clover: Use conversion operator to initialize build log from compat::string.

Fixes binary garbage in the compilation logs caused by
compat::string::c_str() not being null-terminated (which is a bug on
its own that will be fixed in another commit).

Reported-by: EdB <edb+mesa@sigluy.net>
ore/program.cpp
da1d32490998606a32fa256b40527afe37c8f66f 19-Aug-2014 Emil Velikov <emil.l.velikov@gmail.com> st/clover: sort the sources list

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
akefile.am
akefile.sources
eae9da879f3143507ef0e238a7e4faa87114d54e 27-Aug-2014 Michel Dänzer <michel.daenzer@amd.com> st/clover: Fix build against LLVM SVN >= r216583

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
2a553e4dc9f7728464f84f23f0fb6c76648990f0 21-Aug-2014 Aaron Watry <awatry@gmail.com> st/clover: Change platform name from Default to Clover

Signed-off-by: Aaron Watry <awatry at gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/platform.cpp
3ba225c1ab3682fcba33c8b4103afed22e3b3621 21-Aug-2014 Michel Dänzer <michel.daenzer@amd.com> st/clover: Fix build against LLVM SVN >= r215967 v2

v2: Tom Stellard
- Properly destroy the Module

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
e9a4e74926ab67d1750c39b49a54df6fbcb0b593 16-Aug-2014 Francisco Jerez <currojerez@riseup.net> clover: Refuse to build a program if there are kernel objects attached to it.

Fixes piglit cl-api-build-program.

Tested-by: EdB <edb+mesa@sigluy.net>
pi/program.cpp
ore/kernel.cpp
ore/kernel.hpp
ore/program.cpp
ore/program.hpp
c6817f19f60b9b87f55f67cd4dc304a5a2f32414 17-Aug-2014 Francisco Jerez <currojerez@riseup.net> clover/util: Pass initial count value to ref_counter constructor.

And mark the ref_count() method as const.

Tested-by: EdB <edb+mesa@sigluy.net>
til/pointer.hpp
37e4d22e957b59483ecbec4c036476f944a584dc 17-Aug-2014 Francisco Jerez <currojerez@riseup.net> clover/util: Implement minimalist reference to clover::ref_counter object.

Tested-by: EdB <edb+mesa@sigluy.net>
til/pointer.hpp
ce4d3f3104b01b6148ce7b1c7ecd354fd2f062c9 05-Aug-2014 EdB <edb+mesa@sigluy.net> clover: clGetProgramInfo support for OpenCL 1.2.

[ Francisco Jerez: Rework using fold() for conciseness. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Tested-by: EdB <edb+mesa@sigluy.net>
pi/program.cpp
ed3f7eadad1527447df14ee0c33fdf75fcad47b1 08-Aug-2014 Tom Stellard <thomas.stellard@amd.com> clover: Flush the command queue in clReleaseCommandQueue()

This is required by the spec.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>

CC: "10.2" <mesa-stable@lists.freedesktop.org>
pi/queue.cpp
ec73778f1fd6e14623422d62605fc69dc8fb7aa4 07-Aug-2014 Bruno Jiménez <brunojimen@gmail.com> clover: Add support for CL_MAP_WRITE_INVALIDATE_REGION

OpenCL 1.2 CL_MAP_WRITE_INVALIDATE_REGION sounds a lot like
PIPE_TRANSFER_DISCARD_RANGE:

From OpenCL 1.2 spec:
The contents of the region being mapped are to be discarded.

From p_defines.h:
Discards the memory within the mapped region.

v2: Move the code for validating flags to the front-end as
suggested by Francisco Jerez

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/transfer.cpp
ore/resource.cpp
04f2c88f45e26d7050cc88aaaac8e8154d6018d0 24-Jul-2014 Marek Olšák <marek.olsak@amd.com> gallium: rename shader cap MAX_CONSTS to MAX_CONST_BUFFER_SIZE

This new name isn't so confusing.

I also changed the gallivm limit, because it looked wrong.

Reviewed-by: Brian Paul <brianp@vmware.com>

v2: use sizeof(float[4])
ore/device.cpp
3d636b47859ba084799a4caa34d22e622487f89e 25-Jul-2014 Tom Stellard <thomas.stellard@amd.com> clover: Add checks for image support to the image functions v2

Most image functions are required to return a CL_INVALID_OPERATION
error when used on devices without image support.

v2:
- Simplified the code

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/memory.cpp
pi/sampler.cpp
pi/transfer.cpp
1d3e06c21670df4b83c15e39cbac0bc646177e0b 27-Jul-2014 EdB <edb+mesa@sigluy.net> clover: Add clUnloadPlatformCompiler.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/dispatch.cpp
pi/program.cpp
39869423cb082c5feaa5ecf9119d3b97b5cdda88 27-Jul-2014 EdB <edb+mesa@sigluy.net> clover: Add clCreateProgramWithBuiltInKernels.

[ Francisco Jerez: Check for devices not associated with the specified
context. Style fix. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/dispatch.cpp
pi/program.cpp
0ec858764204bf502535b799210db674de7c9e8a 24-Jul-2014 Tom Stellard <thomas.stellard@amd.com> clover: Query the device to see if images are supported

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/device.cpp
ore/device.cpp
ore/device.hpp
74dfd86ed69c11bd4eddee60ac8a14c39e4d5fc4 16-Jul-2014 Tom Stellard <thomas.stellard@amd.com> clover: Call end_query before getting timestamp result v2

v2:
- Move the end_query() call into the timestamp constructor.
- Still pass false as the wait parameter to get_query_result().

Reviewed-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>

CC: "10.2" <mesa-stable@lists.freedesktop.org>
ore/timestamp.cpp
2ab44f657e3c8800aa610d39a04e88d6bf3bad01 10-Jun-2014 Matt Arsenault <arsenm2@gmail.com> clover: Fix not setting build log if the build succeeds v2

If there were only warnings, they would not be added to the log.

v2:
- Use compat::string.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/compiler.hpp
ore/error.hpp
ore/program.cpp
lvm/invocation.cpp
til/compat.hpp
d2504ead2f7eb02b6a33545de2cf1b5957306fd6 21-Jun-2014 Francisco Jerez <currojerez@riseup.net> clover: Have compat::string allocate its own memory.
pi/kernel.cpp
til/compat.hpp
43e4b3e311df3bede930229380a7aa389ac7019a 27-Jun-2014 Ilia Mirkin <imirkin@alum.mit.edu> gallium: add an index argument to create_query

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
ore/timestamp.cpp
4a39e5073a7d0cd8243c6f963567a9945265490c 14-Jun-2014 Francisco Jerez <currojerez@riseup.net> clover: Calculate the serialized size of a module efficiently.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
pi/program.cpp
ore/module.cpp
ore/module.hpp
ab023c27a374bb69bd7300b5b6f0789844fc8ba9 14-Jun-2014 Francisco Jerez <currojerez@riseup.net> clover: Optimize module serialization for vectors of fundamental types.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
ore/module.cpp
4aa128a123d7285677a527e724809339f15d33a7 17-Jun-2014 Tom Stellard <thomas.stellard@amd.com> clover: Don't use llvm's global context

An LLVMContext should only be accessed by a single and using the global
context was causing crashes in multi-threaded environments. Now we use
a separate context for each compile.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>

CC: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
lvm/invocation.cpp
0cc391f0136c1532701a04c9b2f3a4cc49f25e8c 12-May-2014 Tom Stellard <thomas.stellard@amd.com> clover: Prevent Clang from printing number of errors and warnings to stderr.

https://bugs.freedesktop.org/show_bug.cgi?id=78581

CC: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
lvm/invocation.cpp
2a0dffa0c91cc2277f82c2b87277f56e525f87ab 30-May-2014 Bruno Jiménez <brunojimen@gmail.com> clover: query driver for the max number of compute units

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/device.cpp
ore/device.cpp
ore/device.hpp
c5f0c98c49a78777b2564a53028e345195ef275f 09-May-2014 Tom Stellard <thomas.stellard@amd.com> clover: Destory pipe_screen when device does not support compute v2

v2:
- Make sure screen was successfully created before destroying it.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/device.cpp
e05cebafd8ff127ead71fadc20f2e2c8c719481a 30-Apr-2014 Tom Stellard <thomas.stellard@amd.com> clover: Add a stub implementation of clCreateImage() v3

Now that we are uisng the OpenCL 1.2 headers, applications expect all
the OpenCL 1.2 functions to be implemented.

This fixes linking errors with the piglit CL tests.

v2:
- Use c++ features
- Fix error code handling

v3:
- Move <iostream> into api/util.hpp
- Fix indentation

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/dispatch.cpp
pi/dispatch.hpp
pi/memory.cpp
pi/util.hpp
ca848e8bee7683e296e40a7870750d8a156850ca 18-Apr-2014 Tom Stellard <thomas.stellard@amd.com> clover: Query drivers for max clock frequency

Igor Gnatenko:

v2: PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY instead of
PIPE_COMPUTE_MAX_CLOCK_FREQUENCY

Bruno Jiménez:

v3: Drivers report clock in Mhz

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/device.cpp
ore/device.cpp
ore/device.hpp
7fb05f929802bf32391e416ceb62a34b4571905c 27-Apr-2014 EdB <edb+mesa@sigluy.net> clover: Stub implementation of CL 1.2 sub-devices.

The implementation is basically a NOP but it conforms with OpenCL 1.2.

[ Francisco Jerez: Initialize property return buffer for
CL_DEVICE_PARTITION_PROPERTIES, CL_DEVICE_PARTITION_TYPE,
CL_DEVICE_PARTITION_AFFINITY_DOMAIN, and make the latter a scalar
rather than a vector. Some clean-up and code style fixes. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/device.cpp
pi/dispatch.cpp
pi/dispatch.hpp
5827781d25d2e27ebbcfc2362fcc14cc710bccf5 26-Apr-2014 EdB <edb+mesa@sigluy.net> clover: Add clEnqueue{Marker, Barrier}WithWaitList.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/dispatch.cpp
pi/event.cpp
7b11c97d31ea9ebdf5d4b89e60bcc96d256aa7a4 25-Apr-2014 Jan Vesely <jan.vesely@rutgers.edu> clover: Align kernel argument sizes to nearest power of 2

v2: use a new variable for aligned size
add comment
make both vars const
only use the aligned value in argument constructors
fix comment typo

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
df985cc8f649fa533737ac71b60db00b9b0c6d41 26-Apr-2014 Francisco Jerez <currojerez@riseup.net> clover: Avoid warnings from references to deprecated CL 1.1 APIs.

Acked-by: Tom Stellard <thomas.stellard@amd.com>
pi/dispatch.hpp
beadd6b0ccb3e0d58deaa649b267f02fd86648a0 26-Apr-2014 Francisco Jerez <currojerez@riseup.net> clover: Update OpenCL headers to version 1.2 from Khronos.

The C++ headers are *not* updated because they rely on CL 1.2 APIs
that we do not implement yet when the core CL 1.2 headers are present.

Acked-by: Tom Stellard <thomas.stellard@amd.com>
akefile.am
4ccff1499c956b51f18710c7308cbce883f64cd9 04-Apr-2014 Francisco Jerez <currojerez@riseup.net> clover: Document that the *obj*() helpers already take care of object validation.
ore/object.hpp
8d8d0cb09eb8735a04fc36cc4d0e2dc9f9d460eb 21-Mar-2014 Tom Stellard <thomas.stellard@amd.com> clover: Fix typo in validate_object()

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/transfer.cpp
d70ad1a4f9110d206b079398dc1c3be43894f3e5 14-Mar-2014 Francisco Jerez <currojerez@riseup.net> clover: Fix region size error checking in some buffer transfer commands.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
pi/transfer.cpp
9ceee5f4be09702fc881c922b5ad489cd03c76f8 07-Mar-2014 Michel Dänzer <michel.daenzer@amd.com> clover: Fix build against LLVM SVN r203065 or newer

llvm/Linker.h was moved to llvm/Linker/Linker.h.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
lvm/invocation.cpp
262e15fdd401d72045c37a7877efdec1038edec8 04-Mar-2014 Tom Stellard <thomas.stellard@amd.com> clover: Use correct LLVM version in #if for DataLayout construction

Spotted by Michel Dänzer.
lvm/invocation.cpp
79c83837c93ddcdd39ffa5d701117b7126bad65f 02-Mar-2014 Bruno Jiménez <brunojimen@gmail.com> clover: Fix building with latest llvm

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
akefile.am
54df6a049110464c4ba2ad97b12b69ede927eca4 25-Feb-2014 Tom Stellard <thomas.stellard@amd.com> Re-commit 'clover: Fix build with LLVM 3.5'

This was accidentally reverted in 9dfd7c5f75c806801b1b4b4d405899236c09ba75
lvm/invocation.cpp
9dfd7c5f75c806801b1b4b4d405899236c09ba75 25-Feb-2014 Timothy Arceri <t_arceri@yahoo.com.au> Revert "Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/mesa"

This reverts commit 1b79582f322d4a89dd6d197c8d4962c788ae7f25, reversing
changes made to 376a98d345dfc3da8d5b0f1e489196f861c4e754.
lvm/invocation.cpp
fcd499730b225ec5a35902893c059086ba11b590 25-Feb-2014 Tom Stellard <thomas.stellard@amd.com> clover: Fix build with LLVM 3.5
lvm/invocation.cpp
945d87f95877e198fb2203f47a4ebbccae883978 13-Feb-2014 Tom Stellard <thomas.stellard@amd.com> clover: Pass buffer offsets to the driver in set_global_binding() v3

The offsets will be stored in the handles parameter. This makes
it possible to use sub-buffers.

v2:
- Style fixes
- Add support for constant sub-buffers
- Store handles in device byte order

v3:
- Use endian helpers

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/kernel.cpp
9b2fe7cf96dc25f52ae43c8dfda20ee354c329f2 18-Feb-2014 Francisco Jerez <currojerez@riseup.net> clover: Unabbreviate a few data accessor names for consistency.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
pi/context.cpp
pi/memory.cpp
pi/program.cpp
pi/queue.cpp
ore/context.cpp
ore/context.hpp
ore/format.cpp
ore/queue.cpp
ore/queue.hpp
a0d99937a0b4e778cc0b2e93886c814dd8819f6d 18-Feb-2014 Francisco Jerez <currojerez@riseup.net> clover: Replace the transfer(new ...) idiom with a safer create(...) helper function.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
pi/event.cpp
pi/kernel.cpp
pi/transfer.cpp
pi/util.hpp
ore/platform.cpp
til/pointer.hpp
c4578d2277155c50c8680849763850cddb8e8ec2 18-Feb-2014 Francisco Jerez <currojerez@riseup.net> clover: Migrate a bunch of pointers and references in the object tree to smart references.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
pi/event.cpp
pi/kernel.cpp
pi/memory.cpp
pi/program.cpp
pi/queue.cpp
pi/sampler.cpp
pi/transfer.cpp
ore/context.cpp
ore/context.hpp
ore/device.cpp
ore/event.cpp
ore/event.hpp
ore/kernel.cpp
ore/kernel.hpp
ore/memory.cpp
ore/memory.hpp
ore/platform.cpp
ore/platform.hpp
ore/program.cpp
ore/program.hpp
ore/queue.cpp
ore/queue.hpp
ore/resource.cpp
ore/resource.hpp
ore/sampler.cpp
ore/sampler.hpp
ore/timestamp.cpp
ore/timestamp.hpp
til/functional.hpp
d82b39ce382e035b946b3f961c7afd356f55f4f0 18-Feb-2014 Francisco Jerez <currojerez@riseup.net> clover: Allow storing a range into a container of different (but compatible) element type.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
til/range.hpp
1b9fb2fd9129f834f041efe7f96e83998477c78b 18-Feb-2014 Francisco Jerez <currojerez@riseup.net> clover: Define an intrusive smart reference class.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
til/pointer.hpp
9ae0bd3829a34d4239521d9c7838089395c2336c 18-Feb-2014 Francisco Jerez <currojerez@riseup.net> clover: Some improvements for the intrusive pointer class.

Define some additional convenience operators, clean up the
implementation slightly, and rename it to 'intrusive_ptr' for reasons
that will be obvious in the next commit.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
pi/event.cpp
ore/event.cpp
ore/event.hpp
ore/platform.hpp
ore/queue.hpp
til/pointer.hpp
198cd136b94b2ddfb8e2d50e567f3e391eb93915 16-Feb-2014 Francisco Jerez <currojerez@riseup.net> clover: Fix up NULL constant pointer arguments.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
ore/kernel.cpp
82cd6e6317dc9f2c66bee1fcc0521c97afcadd75 08-Feb-2014 Emil Velikov <emil.l.velikov@gmail.com> st/clover: use VISIBILITY_CXXFLAGS where approapriate

Use the c++ visibility flags when building cpp files.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
akefile.am
6ec210989fa10847091f06fcfcab77dd07618dff 17-Jan-2014 Jan Vesely <jan.vesely@rutgers.edu> clover: Don't crash on NULL global buffer objects.

Specs say "If the argument is a buffer object, the arg_value
pointer can be NULL or point to a NULL value in which case a NULL
value will be used as the value for the argument declared as a
pointer to __global or __constant memory in the kernel."

So don't crash when somebody does that.

v2: Insert NULL into input buffer instead of buffer handle pair
Fix constant_argument too
Drop r600 driver changes

v3: Fix inserting NULL pointer

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/kernel.cpp
26458420d8802a765cf71c75ef9f3b6da6bdfd8d 11-Jan-2014 Emil Velikov <emil.l.velikov@gmail.com> pipe-loader: add support for non-pci (platform) devices

Culled out of the "loader: refactor duplicated code into loader util lib"
patch by Rob Clark.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
ore/device.cpp
bd6266622415fd24016f5c8e47c8b9cb654ea089 14-Jan-2014 Francisco Jerez <currojerez@riseup.net> clover: Fix clover::keys and ::values to deal with r-value references properly.

Returning a reference is incorrect if the specified pair was a
temporary -- Instead of that, use decltype() to deduce the correct
return type qualifiers. Fixes a crash in clCreateProgramWithBinary().

Reported-and-tested-by: "Dorrington, Albert" <albert.dorrington@lmco.com>
til/functional.hpp
5662602ba050a43a01c1e06bdfeea83ec792852e 14-Jan-2014 Francisco Jerez <currojerez@riseup.net> clover: Don't try to build programs created from a binary again.

According to the spec it's allowed to call clBuildProgram() on a
program created from a user-specified binary. We don't need to do
anything to build the program in that case.

Reported-and-tested-by: "Dorrington, Albert" <albert.dorrington@lmco.com>
ore/program.cpp
ore/program.hpp
5195f1d9c666bb6ac5faf39ea0df693ed28adbf0 14-Jan-2014 Francisco Jerez <currojerez@riseup.net> clover: Add missing fields to the clover::module serialization code.

Tested-by: "Dorrington, Albert" <albert.dorrington@lmco.com>
ore/module.cpp
efcc84f425f26905e0c6627993108e5927bd81b3 14-Jan-2014 Francisco Jerez <currojerez@riseup.net> clover: Store map result into a temporary vector in clCreateProgramWithBinary.

This avoids the inefficient multiple evaluation of the map result in
the code below. It should cause no functional changes.

Tested-by: "Dorrington, Albert" <albert.dorrington@lmco.com>
pi/program.cpp
e457aca7fa477bfa2fbd57f1d0c8155206cfd8e8 14-Jan-2014 Francisco Jerez <currojerez@riseup.net> clover: Use cl_ulong in the maximum allocation size calculation to avoid overflow.
pi/memory.cpp
862f55c29c50798942e58ea75c5294921c0489f8 08-Nov-2013 Aaron Watry <awatry@gmail.com> clover: Remove unused variable

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
lvm/invocation.cpp
56647c5d8f8e60269f0a3277e3caa7ee57d1fe6a 15-Dec-2013 Jan Vesely <jan.vesely@rutgers.edu> clover: Append buffers that use CL_MEM_USE_HOST_PTR.

Specs say it's legal for implementations to use internal copies, and
the write synchronization seems to work. Fixes clCreateBuffer
(together with previous patches) and buffer-flags piglits.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Acked-by: Francisco Jerez <currojerez@riseup.net>
ore/memory.cpp
21f82188ce389a2543c894dd6d88fbebb25cc796 17-Dec-2013 Jan Vesely <jan.vesely@rutgers.edu> clover: Add parameter checks to clCreateBuffer.

v2: Use fewer if statements and functional tricks instead of single-use method,
suggested by Francisco Jerez.
Squash two small patches into one.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/memory.cpp
ce34158680bca4de85499fb8addaf766bf3159cf 27-Nov-2013 Francisco Jerez <currojerez@riseup.net> clover: Fix missing minus sign in 'iterator_adaptor::operator-='.

The method is currently unused, this probably doesn't fix anything at
this point.
til/adaptor.hpp
a84dd2398f75c672293122408828ac66bb7052a0 16-Nov-2013 Tom Stellard <thomas.stellard@amd.com> clover: Optionally return context's devices from clGetProgramInfo()

The spec allows clGetProgramInfo() to return information about either
the devices associated with the program or the devices associated
with the context. If there are no devices associated with the program,
then we return devices associated with the context.

https://bugs.freedesktop.org/show_bug.cgi?id=52171

Reviewed-by: Francisco Jerez <currojerez@riseup.net>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
pi/program.cpp
fc51e7ac58d7aeab0b455e9d39b6547c2b954494 12-Nov-2013 Matt Turner <mattst88@gmail.com> clover: Remove dead file from Makefile.sources.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
akefile.sources
17af4dd52b0530b671fb7ae64345500f62ed7ee3 11-Apr-2013 Tom Stellard <thomas.stellard@amd.com> clover: Support multiple devices in clCreateContextFromType() v2

v2:
- Use clGetDeviceIDs to query devices.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
pi/context.cpp
99d447cc5dafa3a36b970068961989cced62e3b6 12-Nov-2013 Francisco Jerez <currojerez@riseup.net> clover: Fix the const variant of adaptor_range::end to deal with mismatching range sizes.

Fixes infinite loop in find_grid_optimal_factor() in cases where the
user specifies a grid size with less dimensions than the device
supports.

Reported-by: Tom Stellard <thomas.stellard@amd.com>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
til/range.hpp
bf045bf9b409c47019fa7d9c859eaf8d50dd7032 04-Nov-2013 Francisco Jerez <currojerez@riseup.net> clover: Calculate optimal work group size when it's not specified by the user.

Inspired by a patch sent to the mailing list by Tom Stellard, but
using a different algorithm to calculate the optimal block size that
has been found to be considerably more effective.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
akefile.sources
pi/kernel.cpp
ore/kernel.cpp
ore/kernel.hpp
til/factor.hpp
67a303744434c9129931e9627d97e34af6bef8f3 04-Nov-2013 Francisco Jerez <currojerez@riseup.net> clover: Constify some command_queue arguments.
pi/kernel.cpp
6e9206bdccda628682204fa0b35b2bf698d64295 30-Oct-2013 Francisco Jerez <currojerez@riseup.net> clover: Workaround compiler bug present in GCC 4.7.0-4.7.2.

Variadic template aliases make these versions of GCC very confused,
write down the full type spec instead.
til/range.hpp
1b2c6cd205bc35f0409ccf055a77e8ca6eab0db3 01-Nov-2013 Aaron Watry <awatry@gmail.com> clover: fix build with LLVM 3.4

dso_list was added as an argument for createInternalizePass in 3.4, and then
it was removed again in the same llvm version.

Tested-by: Mike Lothian <mike@fireburn.co.uk>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
lvm/invocation.cpp
193594a1b87e4c63cf034fdb6eadeff7b58eed12 29-Oct-2013 Tom Stellard <thomas.stellard@amd.com> clover: Don't install headers when using the icd

The ICD loader should be responsible for installing headers.

Reviewed and Tested-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
akefile.am
b8f89fc5cbd41a45130630080ffc921c60604545 29-Oct-2013 Francisco Jerez <currojerez@riseup.net> clover: Use context device list for error checking in clGetProgramBuildInfo.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=70891.

Reported-by: Bruno Jiménez <brunojimen@gmail.com>
pi/program.cpp
7463abd37d65abd4d87abe314e0629c853dd9bca 24-Oct-2013 Francisco Jerez <currojerez@riseup.net> clover: Query maximum kernel block size from the device instead of the kernel object.

Based on a similar fix from Aaron Watry. It seems unlikely that we
will ever need a kernel-specific setting for this, and the Gallium API
doesn't support it. Remove kernel::max_block_size() altogether.
pi/kernel.cpp
ore/kernel.cpp
ore/kernel.hpp
til/algorithm.hpp
2901e2efcd28c1041b2afc145812c0ab7f75bf2a 23-Oct-2013 David Heidelberger <david.heidelberger@ixit.cz> clover: fix build after a3ed98f7aa85636579a5696bf036ec13e5c9104a
ore/kernel.cpp
e26ed750668f1eb7aa9c81224bfd0c4a5f72e282 19-Oct-2013 Francisco Jerez <currojerez@riseup.net> clover: Improve region and pitch argument handling in memory transfer APIs.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
pi/transfer.cpp
adefa84d66b13a4892bbc544194bacdc410fcc4e 19-Oct-2013 Francisco Jerez <currojerez@riseup.net> clover: Add a pixel_size() method to the image class.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
ore/memory.cpp
ore/memory.hpp
6230f77232a4703c9f98f569104ac03430a5fb95 06-Oct-2013 Francisco Jerez <currojerez@riseup.net> clover: Implement support for the ICD extension.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
akefile.sources
pi/context.cpp
pi/device.cpp
pi/dispatch.cpp
pi/dispatch.hpp
pi/event.cpp
pi/kernel.cpp
pi/memory.cpp
pi/platform.cpp
pi/program.cpp
pi/queue.cpp
pi/sampler.cpp
pi/transfer.cpp
pi/util.hpp
ore/object.hpp
9a5afd0dbd5cd7d45de926da2299b5a538b9b383 24-Jul-2013 Francisco Jerez <currojerez@riseup.net> clover: Make sure hidden is the default symbol visibility.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
akefile.am
07567c17f1eae1feccf160a144fe1563599e5fc0 18-Sep-2013 Tom Stellard <thomas.stellard@amd.com> clover: Prepare the build system for ICD support.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
akefile.am
9e0b7f76f95dd45c99e95076badba2c8f123c31a 19-Sep-2013 Francisco Jerez <currojerez@riseup.net> clover: Fix memory leak when initializing a device object fails.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
ore/platform.cpp
1d741e3ac06300437c26675e5503a8b791970e0b 16-Sep-2013 Francisco Jerez <currojerez@riseup.net> clover: Tidy up resource::mapping.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
ore/resource.cpp
ore/resource.hpp
6db102597a0978f53e19c59244cf6ef10babae26 16-Sep-2013 Francisco Jerez <currojerez@riseup.net> clover: Simplify command_queue::flush().

Tested-by: Tom Stellard <thomas.stellard@amd.com>
ore/queue.cpp
ore/queue.hpp
7a9bbff7d641b82deae73e043fe1f02b7492993b 17-Sep-2013 Francisco Jerez <currojerez@riseup.net> clover: Clean up the kernel and program object interface.

[ Tom Stellard: Make sure to bind global arguments before retrieving handles. ]
Tested-by: Tom Stellard <thomas.stellard@amd.com>
pi/kernel.cpp
pi/program.cpp
ore/kernel.cpp
ore/kernel.hpp
ore/module.cpp
ore/module.hpp
ore/program.cpp
ore/program.hpp
10284b1d2d3f59c2d54b8c975c400be29548e0cc 17-Sep-2013 Francisco Jerez <currojerez@riseup.net> clover: Clean up the interface of the context object slightly.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
pi/context.cpp
pi/program.cpp
pi/queue.cpp
ore/context.cpp
ore/context.hpp
ore/format.cpp
5226eacf8d4ea395062bf594079acc747bcd6e97 17-Sep-2013 Francisco Jerez <currojerez@riseup.net> clover: Delete copy constructors and assignment operators in all non-copiable objects.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
ore/context.hpp
ore/device.cpp
ore/device.hpp
ore/event.hpp
ore/kernel.hpp
ore/memory.hpp
ore/platform.hpp
ore/program.hpp
ore/queue.hpp
ore/resource.hpp
ore/sampler.hpp
369419f761f26dffd61fd614e5e28bb4cd02e867 17-Sep-2013 Francisco Jerez <currojerez@riseup.net> clover: Define a few convenience equality operators.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
pi/device.cpp
pi/event.cpp
pi/kernel.cpp
ore/context.cpp
ore/context.hpp
ore/device.cpp
ore/device.hpp
ore/format.hpp
ore/memory.cpp
ore/memory.hpp
c6e7a0d0d38d415a515f1e2ddcce5583d73d2937 17-Sep-2013 Francisco Jerez <currojerez@riseup.net> clover: Simplify the platform object by using util/range.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
ore/device.hpp
ore/platform.cpp
ore/platform.hpp
e5fc61fa3f4ef7e00d66003b7f0298f7e20b2cc3 17-Sep-2013 Francisco Jerez <currojerez@riseup.net> clover: Add property list helpers with a syntax consistent with other API objects.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
pi/context.cpp
pi/util.hpp
ore/context.cpp
ore/context.hpp
ore/property.hpp
04d0ab9f6456229df1a83b0b1c133e1c458aedd2 16-Sep-2013 Francisco Jerez <currojerez@riseup.net> clover: Switch samplers to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
pi/sampler.cpp
ore/error.hpp
ore/kernel.cpp
ore/object.hpp
ore/queue.hpp
ore/sampler.cpp
ore/sampler.hpp
d6f7afc3ed41a94175a0fdf9cf9651750104974c 01-Oct-2013 Francisco Jerez <currojerez@riseup.net> clover: Switch memory objects to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
pi/memory.cpp
pi/transfer.cpp
ore/error.hpp
ore/kernel.cpp
ore/memory.cpp
ore/memory.hpp
ore/object.hpp
ore/resource.cpp
ore/resource.hpp
35307f540fedf9680ce8b05d0784c5b0d5b0f6a7 18-Sep-2013 Francisco Jerez <currojerez@riseup.net> clover: Switch kernel and program objects to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
pi/kernel.cpp
pi/program.cpp
ore/error.hpp
ore/kernel.cpp
ore/kernel.hpp
ore/object.hpp
ore/program.cpp
ore/program.hpp
ore/queue.hpp
ore/resource.hpp
ore/sampler.hpp
9968d9daf264b726ee50bbc97937daac4e9c1811 01-Oct-2013 Francisco Jerez <currojerez@riseup.net> clover: Switch command queues to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
pi/event.cpp
pi/kernel.cpp
pi/queue.cpp
pi/transfer.cpp
ore/device.hpp
ore/error.hpp
ore/event.hpp
ore/kernel.cpp
ore/memory.cpp
ore/memory.hpp
ore/object.hpp
ore/queue.cpp
ore/queue.hpp
ore/timestamp.hpp
257781f243476863591965f22787ff390edd8ba0 01-Oct-2013 Francisco Jerez <currojerez@riseup.net> clover: Switch event objects to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
pi/event.cpp
pi/kernel.cpp
pi/transfer.cpp
ore/error.hpp
ore/event.cpp
ore/event.hpp
ore/object.hpp
9d06fb8fa86a70d1c3a4924960dfebabaf1fa3bf 16-Sep-2013 Francisco Jerez <currojerez@riseup.net> clover: Switch context objects to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
pi/context.cpp
pi/event.cpp
pi/memory.cpp
pi/program.cpp
pi/queue.cpp
pi/sampler.cpp
ore/context.cpp
ore/context.hpp
ore/device.hpp
ore/error.hpp
ore/format.cpp
ore/format.hpp
ore/object.hpp
c9e009b74d4ca4c471d3d77960f232035876aaa8 16-Sep-2013 Francisco Jerez <currojerez@riseup.net> clover: Switch device objects to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
pi/context.cpp
pi/device.cpp
pi/kernel.cpp
pi/program.cpp
pi/queue.cpp
ore/device.cpp
ore/device.hpp
ore/error.hpp
ore/object.hpp
49a49e0742dde4aa6d0c870d795a480425e85f52 17-Sep-2013 Francisco Jerez <currojerez@riseup.net> clover: Switch platform objects to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
pi/device.cpp
pi/platform.cpp
ore/device.hpp
ore/error.hpp
ore/object.hpp
ore/platform.cpp
ore/platform.hpp
bff60c894a290260ab3dd2086445b44622a2800e 06-Oct-2013 Francisco Jerez <currojerez@riseup.net> clover: Define helper classes for the new object model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
akefile.sources
pi/util.hpp
ore/base.hpp
ore/compiler.hpp
ore/context.hpp
ore/device.hpp
ore/error.hpp
ore/event.hpp
ore/format.hpp
ore/kernel.hpp
ore/memory.hpp
ore/object.hpp
ore/platform.hpp
ore/program.cpp
ore/program.hpp
ore/queue.hpp
ore/resource.hpp
ore/sampler.hpp
ore/timestamp.hpp
lvm/invocation.cpp
d8b499428183178885bb182c898ee6f52e92ef03 06-Oct-2013 Francisco Jerez <currojerez@riseup.net> clover: Clean up property query functions by using a new property_buffer helper class.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
akefile.sources
pi/context.cpp
pi/device.cpp
pi/event.cpp
pi/kernel.cpp
pi/memory.cpp
pi/platform.cpp
pi/program.cpp
pi/queue.cpp
pi/sampler.cpp
pi/util.hpp
ore/property.hpp
7d61769e447e47022bea5e9fd415344b45a5a050 06-Oct-2013 Francisco Jerez <currojerez@riseup.net> clover: Switch to the new utility code.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
akefile.sources
pi/context.cpp
pi/kernel.cpp
pi/program.cpp
pi/transfer.cpp
pi/util.hpp
ore/base.hpp
ore/compat.hpp
ore/compiler.hpp
ore/event.cpp
ore/geometry.hpp
ore/kernel.cpp
ore/memory.cpp
ore/module.hpp
ore/program.cpp
ore/resource.cpp
ore/resource.hpp
099d281b38fae791300984964fab1124b0eb14d2 16-Sep-2013 Francisco Jerez <currojerez@riseup.net> clover: Name include guards consistently.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
pi/util.hpp
ore/base.hpp
ore/compat.hpp
ore/compiler.hpp
ore/context.hpp
ore/device.hpp
ore/event.hpp
ore/format.hpp
ore/geometry.hpp
ore/kernel.hpp
ore/memory.hpp
ore/module.hpp
ore/platform.hpp
ore/program.hpp
ore/queue.hpp
ore/resource.hpp
ore/sampler.hpp
8e14b82fd2c561cac3e0d5f84d5f67815ad53867 18-Sep-2013 Francisco Jerez <currojerez@riseup.net> clover: Replace a bunch of double underscores with single underscores.

Identifiers with double underscores are reserved, and using them has
undefined behavior according to the C++ spec. It's unlikely to make
any difference, but...

Tested-by: Tom Stellard <thomas.stellard@amd.com>
pi/platform.cpp
pi/transfer.cpp
pi/util.hpp
ore/base.hpp
ore/compat.hpp
ore/compiler.hpp
ore/context.cpp
ore/context.hpp
ore/device.hpp
ore/event.cpp
ore/event.hpp
ore/format.hpp
ore/geometry.hpp
ore/kernel.cpp
ore/kernel.hpp
ore/memory.cpp
ore/memory.hpp
ore/module.cpp
ore/module.hpp
ore/platform.hpp
ore/program.cpp
ore/program.hpp
ore/queue.cpp
ore/queue.hpp
ore/resource.hpp
ore/sampler.cpp
ore/sampler.hpp
ebfdce079b8f99f92dff4d58a53c27e0888c373f 06-Oct-2013 Francisco Jerez <currojerez@riseup.net> clover: Clean up the event profiling code.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
akefile.sources
pi/event.cpp
ore/event.cpp
ore/event.hpp
ore/queue.cpp
ore/queue.hpp
ore/timestamp.cpp
ore/timestamp.hpp
e93efa0d505e0337629b178d970e369c0745911d 06-Oct-2013 Francisco Jerez <currojerez@riseup.net> clover: Import new utility library.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
oxyfile
akefile.sources
til/adaptor.hpp
til/algebra.hpp
til/algorithm.hpp
til/compat.cpp
til/compat.hpp
til/functional.hpp
til/lazy.hpp
til/pointer.hpp
til/range.hpp
til/tuple.hpp
4f49c97afe24199cafbb51db37e642ed5c5235cc 02-Oct-2013 Tom Stellard <thomas.stellard@amd.com> clover: Use std::numeric_limits<std::size_t>::max() instead of SIZE_MAX

This prevents a build failure on some systems.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/kernel.cpp
de1de88dfc478db597726d88231c6c0a7f936121 16-Sep-2013 Tom Stellard <thomas.stellard@amd.com> clover: Link libclc before running any optimizations

This is required in order for clang to correctly handle the OpenCL C
barrier() builtin which has the following restrictions acording to
the OpenCL 1.1 Specification:

If barrier is inside a conditional statement, then all work-items must
enter the conditional if any work-item enters the conditional statement
and executes the barrier.

If barrier is inside a loop, all work-items must execute the barrier for
each iteration of the loop before any are allowed to continue execution
beyond the barrier.

By linking before otimizations, we can replace calls to barrier() with
calls to a target specific intrinsic which has the noduplicate attribute
This attribute prevents clang from performing optimizations which could
violate the above rules.

This attribute must be applied to the call instruction that invokes
the function, so it is not enough to add this attribute the barrier()
declaration.

As a bonus this will probably speed up compile times since we will no
longer need to run link-time optimizations.
lvm/invocation.cpp
72465fcf57278c43df0290e07d68371c6c292f27 04-Oct-2013 Laurent Carlier <lordheavym@gmail.com> clover: fix building with llvm-3.4 since rev191922

http://llvm.org/viewvc/llvm-project?view=revision&revision=191922
lvm/invocation.cpp
93e6694f2cdc3a93d1f33d178639aadfa7edb431 16-Sep-2013 Brian Paul <brianp@vmware.com> clover: remove bind_compute_sampler_states() calls
ore/kernel.cpp
4bdf7d38422b070d7ec8fa3e15498a6bb35fe7a8 12-Sep-2013 Brian Paul <brianp@vmware.com> clover: use pipe_context::bind_sampler_states() if non-null
ore/kernel.cpp
d8afbc6177ed00617a1dbb935042074227a1df5b 22-Sep-2013 Emil Velikov <emil.l.velikov@gmail.com> st/clover: consolidate CPP sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
akefile.am
akefile.sources
f3e86d4a68c27f0e86d64a98469a48756c445498 27-Aug-2013 Tom Stellard <thomas.stellard@amd.com> clover: Don't use PIPE_TRANSFER_UNSYNCHRONIZED for blocking copies

CC: "9.2" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/resource.cpp
ef6ed7220af51d7ae2ee132829f46a8b08d9796b 09-Aug-2013 Niels Ole Salscheider <niels_ole@salscheider-online.de> st/clover: Add event to deps even if it has been triggered

The command is submitted once the event has been triggered, but it might not
have completed yet. Therefore, we have to add it to deps in order to wait on it.

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/event.cpp
4a3505d5487fbdab773f5c91edd39e8aea6e90af 09-Aug-2013 Niels Ole Salscheider <niels_ole@salscheider-online.de> st/clover: Profiling support

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Acked-by: Francisco Jerez <currojerez@riseup.net>
pi/event.cpp
ore/event.cpp
ore/event.hpp
d9576598c7e1c6e4fee913a918345190248a9d19 24-Jul-2013 Jonathan Charest <jcharest+mesa-dev@gmail.com> clover: Added missing address space checking of kernel parameters v2

Here is an updated patch with no line wrapping and respecting 80-column limit (for my changes).

v2: Tom Stellard
- Create global arguments for constant buffers so we don't break
r600g.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
lvm/invocation.cpp
81a156d099b5c224d4a528b66a80e25626ed65bc 02-Jul-2013 Niels Ole Salscheider <niels_ole@salscheider-online.de> st/clover: Allow double precision operations

Pass "cl_khr_fp64" preprocessor definition to clang

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
lvm/invocation.cpp
df530829f757a8968389427eb26f45a0d46623fa 21-Jul-2013 Francisco Jerez <currojerez@riseup.net> clover: Respect kernel argument alignment restrictions.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
ore/kernel.cpp
lvm/invocation.cpp
f64c0ca692d3e8c78dd9ae1f015f58f1dfc1c760 22-Jul-2013 Francisco Jerez <currojerez@riseup.net> clover: Extend kernel arguments for differing host and device data types.

Loosely based on a similar patch by Tom Stellard.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
ore/kernel.cpp
lvm/invocation.cpp
829caf410e2c2c6f79902199da5a7900abc16129 21-Jul-2013 Francisco Jerez <currojerez@riseup.net> clover: Byte-swap kernel arguments when host and device endianness differ.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
ore/kernel.cpp
2265b40e377cc2c9d1091498df2aede5df2ff684 21-Jul-2013 Francisco Jerez <currojerez@riseup.net> clover: Add kernel argument fields to allow differing host/target data types.

Loosely based on a similar patch by Tom Stellard.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
ore/module.hpp
a3dcab43c6b6fed2f35aa0e802be6398985f100c 21-Jul-2013 Francisco Jerez <currojerez@riseup.net> clover: Pass corresponding module::argument to kernel::argument::bind().

And remove size information from most kernel::argument derived
classes, it's no longer going to be necessary.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
ore/kernel.cpp
ore/kernel.hpp
8c9d3c62f60a2819948bdfb005600cdc10aa2547 10-Jul-2013 Tom Stellard <thomas.stellard@amd.com> clover: Return correct value for CL_DEVICE_ENDIAN_LITTLE

Query the driver using PIPE_CAP_ENDIANNESS rather than always returning
true.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/device.cpp
ore/device.cpp
ore/device.hpp
5a925cc5504575c22dbb7d29842d7fc5babcb5c7 06-Jun-2013 Tom Stellard <thomas.stellard@amd.com> clover: Don't segfault when compiling a program with no kernel
lvm/invocation.cpp
0e990736f34c43f553d4516bc6ffb8fe521e3806 27-Jun-2013 Tom Stellard <thomas.stellard@amd.com> clover: Fix build with LLVM 3.4

Reported on IRC by lordheavy
lvm/invocation.cpp
8c347d4e5762b41320a80acf474284b5c096fd0d 02-May-2013 Chia-I Wu <olvaffe@gmail.com> gallium: fix type of flags in pipe_context::flush()

It should be unsigned, not enum pipe_flush_flags.

Fixed a build error:

src/gallium/state_trackers/egl/android/native_android.cpp:426:29: error:
invalid conversion from 'int' to 'pipe_flush_flags' [-fpermissive]

v2: replace all occurrences of enum pipe_flush_flags by unsigned

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>

[olv: document the parameter now that the type is unsigned]
ore/queue.cpp
f0cb66b69904b0a3e4083aa8874af63cf1c14321 21-Apr-2013 Kenneth Graunke <kenneth@whitecape.org> mesa: Restore 78-column wrapping of license text in C++-style comments.

The previous commit introduced extra words, breaking the formatting.

This text transformation was done automatically via the following shell
command:
$ git grep 'THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY' | sed 's/:.*$//' | xargs -I {} sh -c 'vim -e -s {} < vimscript2

where 'vimscript2' is a file containing:
/THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY/;/^ *$/ !fmt -w 78 -p '// '
:wq

Reviewed-by: Brian Paul <brianp@vmware.com>
pi/context.cpp
pi/device.cpp
pi/event.cpp
pi/kernel.cpp
pi/memory.cpp
pi/platform.cpp
pi/program.cpp
pi/queue.cpp
pi/sampler.cpp
pi/transfer.cpp
pi/util.hpp
ore/base.hpp
ore/compat.hpp
ore/compiler.hpp
ore/context.cpp
ore/context.hpp
ore/device.cpp
ore/device.hpp
ore/event.cpp
ore/event.hpp
ore/format.cpp
ore/format.hpp
ore/geometry.hpp
ore/kernel.cpp
ore/kernel.hpp
ore/memory.cpp
ore/memory.hpp
ore/module.cpp
ore/module.hpp
ore/platform.cpp
ore/platform.hpp
ore/program.cpp
ore/program.hpp
ore/queue.cpp
ore/queue.hpp
ore/resource.cpp
ore/resource.hpp
ore/sampler.cpp
ore/sampler.hpp
lvm/invocation.cpp
gsi/compiler.cpp
96ff2edc73ccf11d4d198ba3665507f73ae4a9f7 21-Apr-2013 Kenneth Graunke <kenneth@whitecape.org> mesa: Add "OR COPYRIGHT HOLDERS" to license text disclaiming liability.

This brings the license text in line with the MIT License as published
on the Open Source Initiative website:

http://opensource.org/licenses/mit-license.php

Generated automatically be the following shell command:
$ git grep 'THE AUTHORS BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \
sed -i 's/THE AUTHORS/THE AUTHORS OR COPYRIGHT HOLDERS/' {}

This introduces some wrapping issues, to be fixed in the next commit.

Reviewed-by: Brian Paul <brianp@vmware.com>
pi/context.cpp
pi/device.cpp
pi/event.cpp
pi/kernel.cpp
pi/memory.cpp
pi/platform.cpp
pi/program.cpp
pi/queue.cpp
pi/sampler.cpp
pi/transfer.cpp
pi/util.hpp
ore/base.hpp
ore/compat.hpp
ore/compiler.hpp
ore/context.cpp
ore/context.hpp
ore/device.cpp
ore/device.hpp
ore/event.cpp
ore/event.hpp
ore/format.cpp
ore/format.hpp
ore/geometry.hpp
ore/kernel.cpp
ore/kernel.hpp
ore/memory.cpp
ore/memory.hpp
ore/module.cpp
ore/module.hpp
ore/platform.cpp
ore/platform.hpp
ore/program.cpp
ore/program.hpp
ore/queue.cpp
ore/queue.hpp
ore/resource.cpp
ore/resource.hpp
ore/sampler.cpp
ore/sampler.hpp
lvm/invocation.cpp
gsi/compiler.cpp
02b808b08acc73b9b3d31832a7f137a9aae4bdd9 07-Apr-2013 Francisco Jerez <currojerez@riseup.net> clover: Fix usage of incorrect object as destination in clEnqueueCopyBufferToImage.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
pi/transfer.cpp
1a8ad6c2e3beb00d07ef109b984658e08c5729da 06-Apr-2013 Francisco Jerez <currojerez@riseup.net> clover: Define platform class and merge with device_registry.

Null platform IDs are OK according to the spec, but some applications have
been reported to get paranoid and assume that our NULL platform is unusable.

As it doesn't hurt to have device enumeration separate from the rest of the
device code (quite the opposite, it makes the code cleaner), make the API use
an actual platform object that keeps track of the available devices instead of
the former NULL pointer.

Reported-and-reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
akefile.am
pi/context.cpp
pi/device.cpp
pi/platform.cpp
ore/device.cpp
ore/device.hpp
ore/platform.cpp
ore/platform.hpp
6ace4520559094b755ff1eb038ac68f38faa83c6 13-Apr-2013 Francisco Jerez <currojerez@riseup.net> clover: Add missing fields to the module serializer.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
ore/module.cpp
c5e5b3401c52f83bd885497cb30125e78a21d666 07-Mar-2013 Tom Stellard <thomas.stellard@amd.com> gallium: PIPE_COMPUTE_CAP_IR_TARGET - allow drivers to specify a processor v2

This target string now contains four values instead of three. The old
processor field (which was really being interpreted as arch) has been split
into two fields: processor and arch. This allows drivers to pass a
more a more detailed description of the hardware to compiler frontends.

v2:
- Adapt to libclc changes

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
777a7f2003f260cc383f14029413f48101ae5718 01-Apr-2013 Mike Lothian <mike@fireburn.co.uk> clover: Fix build with LLVM 3.3
lvm/invocation.cpp
3cc2629b3b4bfc3b5c21a5932a3a2e590e60f98a 23-Mar-2013 Dmitry Cherkassov <dcherkassov@gmail.com> clover: add dynamic_cast results checking down in clSetKernelArgument() code path.

Signed-off-by: Dmitry Cherkassov <dcherkassov@gmail.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
ore/kernel.cpp
439c3d4e313370823d49b53f031697cc8b18d171 09-Mar-2013 Matt Turner <mattst88@gmail.com> mesa: Replace MESA_VERSION with PACKAGE_VERSION.

One fewer place to have to update.

Reviewed-by: Eric Anholt <eric@anholt.net>
akefile.am
pi/device.cpp
pi/platform.cpp
aa1c734b3ca445b5af743b9bad6a48ca7ba21f3c 22-Feb-2013 Tom Stellard <thomas.stellard@amd.com> clover: Fix build with LLVM 3.3 v2

v2:
- Fix order that the clang libraries are passed to the linker to avoid
missing symbol errors.

Acked-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
ac2793cf3e1e004942c386dfa45f3b5507223f50 10-Sep-2012 Matt Turner <mattst88@gmail.com> Clean up .gitignore files
gitignore
45270fb0fd1abd7619933c2845f9dc74cdfbe6fd 13-Sep-2012 Matt Turner <mattst88@gmail.com> targets/pipe-loader: Convert to automake

C++ linking (controlled by the nodist_EXTRA idiom) is needed

unconditionally for:
nouveau (uses C++ in the driver)
r300 (since LLVM is always required)
radeonsi (since LLVM is always required)
swrast (if builting LLVM pipe)

and conditionally (depends whether LLVM is enabled) for
i915
r600
vmwgfx

and never needed for swrast (softpipe).

Unfortunately, automake seems to *always* link with C++ if nodist_EXTRA
is specified, even inside a false conditional. Not sure if this is a
bug, but it does seem to be weird behavior.

v2: Johannes Obermayr <johannesobermayr@gmx.de>
- Fix some undefined symbols.

v3: Johannes Obermayr <johannesobermayr@gmx.de>
- Install pipe_* to $(libdir)/gallium-pipe.

v4: Johannes Obermayr <johannesobermayr@gmx.de>
- Build it only once on --enable-gallium-gbm / --enable-opencl.
akefile.am
959e83d65075513f989cb1fe634dca314a7e185f 30-Nov-2012 Johannes Obermayr <johannesobermayr@gmx.de> clover: Adapt libclc's INCLUDEDIR and LIBEXECDIR to make use of the new introduced libclc.pc.

Tom Stellard:
-Keep --with-libclc-path and mark it deprecated.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
akefile.am
lvm/invocation.cpp
54f3a3e88d35c855c43c31ae7c915cfa55d1f5d7 04-Jan-2013 Tom Stellard <thomas.stellard@amd.com> clover: Fix build after the addition of enum pipe_flush_flags

Broken since commit 598cc1f74d7ae924e84dee801b456ab7b0b22f84
ore/queue.cpp
598cc1f74d7ae924e84dee801b456ab7b0b22f84 21-Dec-2012 Marek Olšák <maraeo@gmail.com> gallium: extend pipe_context::flush for it to accept an END_OF_FRAME flag

Usage with pipe_context:
pipe->flush(pipe, NULL, PIPE_FLUSH_END_OF_FRAME);

Usage with st_context_iface:
st->flush(st, ST_FLUSH_END_OF_FRAME, NULL);

The flag is only a hint for drivers. Radeon will use it for buffer eviction
heuristics in the kernel (e.g. for queries like how many frames have passed
since a buffer was used).

The flag is currently only generated by st/dri on SwapBuffers.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
ore/queue.cpp
4330cfec8b5225283bccc03f53a440c20e8e5cb5 13-Dec-2012 Tom Stellard <thomas.stellard@amd.com> clover: Fix build since removal of pipe_surface::usage

by commit 25409c6da8163d9acb386511aef0c11577c7aadb
ore/resource.cpp
c68babfc3c7b65dd53697528781bd6b6186f5190 27-Nov-2012 Tom Stellard <thomas.stellard@amd.com> clover: Add support for compiler flags

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/program.cpp
ore/compiler.hpp
ore/program.cpp
ore/program.hpp
lvm/invocation.cpp
7f71efcf7a8eace124e71ca72c86d4c2bdc8042d 10-Dec-2012 Tom Stellard <thomas.stellard@amd.com> clover: Don't erase build info of devices not being built

Every call to _cl_program::build() was erasing the binaries and logs for
every device associated with the program. This is incorrect because
it is possible to build a program for only a subset of devices and so
any device not being build should not have this information erased.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/program.cpp
b361bb3de4bd8d27f6fcb920e5516e51db00ef73 04-Dec-2012 Johannes Obermayr <johannesobermayr@gmx.de> clover: Install CL headers.

Note: This is a candidate for the stable branches.
akefile.am
b36b6fdb32f58757175d2e727e7a98a63b0e2b76 12-Nov-2012 Tom Stellard <thomas.stellard@amd.com> clover: Fix build with clang 3.2
lvm/invocation.cpp
26fc30ef83a9b1bb3d7379e7816e1f1eaafd6fb3 19-Oct-2012 Francisco Jerez <currojerez@riseup.net> clover: No need for clover::is_zero() to be a functor.

Simplify is_zero() somewhat, and as a side effect work around a gcc compiler
bug that causes build failure.

https://bugs.freedesktop.org/show_bug.cgi?id=56140

Reported-by: Dmitry Cherkassov <dcherkassov@gmail.com>
pi/context.cpp
pi/kernel.cpp
pi/program.cpp
pi/transfer.cpp
ore/base.hpp
dc54c49df9c9e37b00d3ba20455407999e03f391 10-Oct-2012 Tom Stellard <thomas.stellard@amd.com> clover: Fix build with LLVM 3.2

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
369e46888904c6d379b8b477d9242cff1608e30e 08-Oct-2012 Marek Olšák <maraeo@gmail.com> gallium: unify transfer functions

"get_transfer + transfer_map" becomes "transfer_map".
"transfer_unmap + transfer_destroy" becomes "transfer_unmap".

transfer_map must create and return the transfer object and transfer_unmap
must destroy it.

transfer_map is successful if the returned buffer pointer is not NULL.
If transfer_map fails, the pointer to the transfer object remains unchanged
(i.e. doesn't have to be NULL).

Acked-by: Brian Paul <brianp@vmware.com>
ore/resource.cpp
581619f5a70c0e2ef6ac6d1e810b4f5a6e6416d4 24-Sep-2012 Tom Stellard <thomas.stellard@amd.com> clover: Fix build with libclang v3.2

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
lvm/invocation.cpp
71682cf65bd31aca96f0c84434fc57bcfdec89fc 17-Sep-2012 Tom Stellard <thomas.stellard@amd.com> clover: Query device for CL_DEVICE_MAX_MEM_ALLOC_SIZE v2

v2:
- Use driver reported values and don't correct them to the OpenCL
required minimum.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/device.cpp
ore/device.cpp
ore/device.hpp
e59505e34bdea772bb439cb42f2ef20ec495de03 13-Sep-2012 Blaž Tomažič <blaz.tomazic@gmail.com> clover: Handle multiple kernels in the same program v2

v2: Tom Stellard
- Use pc parameter of launch_grid()

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
lvm/invocation.cpp
959fe586fb0d64642facffff8c0132777523ed42 24-Sep-2012 Francisco Jerez <currojerez@riseup.net> clover: Silence narrowing conversion warnings in resource.cpp.
ore/resource.cpp
01877a6fd003d22f17571593dc22414e3fec883d 21-Sep-2012 Tom Stellard <thomas.stellard@amd.com> clover: Handle NULL value for clEnqueueNDRangeKernel local_work_size

[ Francisco Jerez: Slight simplification. ]
pi/kernel.cpp
8ed9aaea5112bcda9ec7120e1c3b6f0447cc6cd2 17-Sep-2012 Tom Stellard <thomas.stellard@amd.com> clover: Initialize height and depth to 1 for transfers

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/transfer.cpp
87280d56a375fcfc9231e72963439f9a370c408a 23-Aug-2012 Blaž Tomažič <blaz.tomazic@gmail.com> clover: Accept CL_MEM_READ_WRITE flag

Fix API functions for memory objects to accept CL_MEM_READ_WRITE flag.

Signed-off-by: Blaž Tomažič <blaz.tomazic@gmail.com>
[ Francisco Jerez: Drop incorrect change in clCreateSubBuffer. ]
pi/memory.cpp
1d21bd057a6b1701dd44a79e82259c0f3ded2b70 28-Jun-2012 Tom Stellard <tstellar@gmail.com> clover: Handle NULL devs argument in clBuildProgram

If devs is NULL, then the kernel should be compiled for all devices
associated with the program.
pi/program.cpp
c6bb41c28b2da269d5b692d1d0f4acbf3cdd4b5c 28-Jun-2012 Francisco Jerez <currojerez@riseup.net> clover: Define non-templated copy constructor for clover::ref_ptr.

The templated copy constructor doesn't prevent the compiler from
emitting a default copy constructor, which leads to inconsistent
memory handling and was reported to cause segfaults when doing event
manipulation.

Reported-by: Tom Stellard <thomas.stellard@amd.com>
ore/base.hpp
ca8fa0230896727af81ee54197f6e2233d49481d 21-Jun-2012 Tom Stellard <thomas.stellard@amd.com> clover: Add a function internalizer pass before LTO v2

The function internalizer pass marks non-kernel functions as internal,
which enables optimizations like function inlining and global dead-code
elimination.

v2:
- Pass vector arguments by const reference
lvm/invocation.cpp
ea76f0331011337cc4b7caac8f25947501a5aef9 15-Jun-2012 Tom Stellard <tstellar@gmail.com> clover: Add --with-clang-libdir option and verify CLANG_RESOURCE_DIR

$CLANG_RESOURCE_DIR is the directory that contains all resources
needed by clang to compile programs. When clover uses clang to
compile kernels it needs to specify a resource dir, so that clang
can find its internal headers (e.g. stddef.h).

clang defines $CLANG_RESOURCE_DIR as $CLANG_LIBDIR/clang/$CLANG_VERSION

This patch adds the --with-clang-libdir option in order to accommodate
clang intalls to non-standard locations, and it also adds a check
to the configure script to verify that $CLANG_RESOURCE_DIR/include
contains the necessary header files.
akefile.am
46a13b3b11d859e131399853c11ae2be0eb02f0a 24-Apr-2012 Tom Stellard <thomas.stellard@amd.com> clover: Add function for building a clover::module for non-TGSI targets v6

v2:
-Separate IR type and LLVM triple
-Do the OpenCL C->LLVM IR and linking steps for all PIPE_SHADER_IR
types.

v3:
- Coding style fixes
- Removed compatibility code for LLVM < 3.1
- Split build_module_llvm() into three functions:
compile(), link(), and build_module_llvm()

v4:
- Use struct pipe_compute_program

v5:
- Don't malloc memory for struct pipe_llvm_program

v6:
- Fix serialization of llvm bytecode

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/compiler.hpp
ore/program.cpp
lvm/invocation.cpp
741463e18d8235025de649210e7f88a1b6e7af5a 25-May-2012 Tom Stellard <thomas.stellard@amd.com> clover: Remove target argument from compile_program_tgsi()

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/compiler.hpp
ore/program.cpp
gsi/compiler.cpp
d724190bce7a10becfb378cad7ef9886ee4d2c8c 24-Apr-2012 Tom Stellard <thomas.stellard@amd.com> clover: Add constructors to some of the module classes v3

This is for the llvm code that can't use extended initializers.

v2:
- Use const references for vector arguments
- Move constructor defs before data members
- Initialize all values in the default constructors

v3:
- Fix typo
ore/module.hpp
5cc08efe8f708633271adc16208f020d79ddca46 24-Apr-2012 Tom Stellard <thomas.stellard@amd.com> clover: Add necessary flags to libclllvm_la_CXXFLAGS

$(LLVM_CFLAGS) for LLVM defines
-DLIBCLC_PATH for libclc path
-DCLANG_RESOURCE_DIR for clang includes
$(DEFINES) for -DHAVE_LLVM
akefile.am
613323b2564babc1ecaac25a6cfd786b8c839315 23-Apr-2012 Tom Stellard <thomas.stellard@amd.com> clover: Add a function for retrieving a device's preferred ir v3

A device now has two function for getting information about the IR
it needs to return.

ir_format() => returns the preferred IR
ir_target() => returns the triple for the target that is understood by
clang/llvm.

v2:
- renamed ir_target() to ir_format()
- renamed llvm_triple() to ir_target()

v3:
- Remove unnecessary include
- Do proper conversion from std::vector<char> to std::string

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
ore/device.cpp
ore/device.hpp
03e3bc4ba56f1021899a5f773b6ec21893619e3a 16-May-2012 Francisco Jerez <currojerez@riseup.net> gallium/auxiliary/pipe-loader: Fix usage of anonymous union.

Anonymous unions aren't part of the C99 standard. Fixes build on GCC
versions older than 4.6.

https://bugs.freedesktop.org/show_bug.cgi?id=50001

Reported-by: Michael Lange <michaell@gmx.org>
ore/device.cpp
821c34ecd9921e7478c8775905bf887b7513100c 14-May-2012 Paul Berry <stereotype441@gmail.com> Add .gitignore files for recently-added gallium projects

This patch adds .gitignore files to ignore the makefiles generated by
the gallium pipe loader and the clover OpenCL state tracker.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
gitignore
b70736fa82c29e83a5ad222f58cfe8aa3b910c88 12-May-2012 Francisco Jerez <currojerez@riseup.net> clover: Fix build on i386.
ore/device.cpp
fcab4d4a34a28ec153612e41d5850884c5ccbfb9 12-May-2012 Francisco Jerez <currojerez@riseup.net> clover: Check the total work-group size provided to clEnqueueNDRangeKernel.
pi/kernel.cpp
5c9bccc97e9fb0776f2ca5bb57e55116a7efb43b 12-May-2012 Christoph Bumiller <e0425955@student.tuwien.ac.at> clover, gallium: add PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK

This is not necessarily the product of MAX_BLOCK_SIZE[i].

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
pi/device.cpp
ore/device.cpp
ore/device.hpp
60e7b08101295099618a3c1f879440b257265253 04-May-2012 Francisco Jerez <currojerez@riseup.net> clover: Implement CL_MEM_COPY_HOST_PTR.
ore/memory.cpp
ore/queue.hpp
ore/resource.cpp
ore/resource.hpp
c6db1b3396384186aab5b685fe1fd540e17b3a62 20-Apr-2012 Francisco Jerez <currojerez@riseup.net> clover: Import OpenCL state tracker.
oxyfile
akefile.am
pi/context.cpp
pi/device.cpp
pi/event.cpp
pi/kernel.cpp
pi/memory.cpp
pi/platform.cpp
pi/program.cpp
pi/queue.cpp
pi/sampler.cpp
pi/transfer.cpp
pi/util.hpp
ore/base.hpp
ore/compat.hpp
ore/compiler.hpp
ore/context.cpp
ore/context.hpp
ore/device.cpp
ore/device.hpp
ore/event.cpp
ore/event.hpp
ore/format.cpp
ore/format.hpp
ore/geometry.hpp
ore/kernel.cpp
ore/kernel.hpp
ore/memory.cpp
ore/memory.hpp
ore/module.cpp
ore/module.hpp
ore/program.cpp
ore/program.hpp
ore/queue.cpp
ore/queue.hpp
ore/resource.cpp
ore/resource.hpp
ore/sampler.cpp
ore/sampler.hpp
lvm/invocation.cpp
gsi/compiler.cpp