Compare commits
20 Commits
llvmorg-7.
...
llvmorg-3.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7d77057b1 | ||
|
|
3858196418 | ||
|
|
d220934514 | ||
|
|
9613d17379 | ||
|
|
52017d6ff3 | ||
|
|
fa04ada805 | ||
|
|
90a7c4a721 | ||
|
|
f94bc6baa5 | ||
|
|
dc300914c3 | ||
|
|
684bfb61c4 | ||
|
|
9daa08a5f4 | ||
|
|
dd7d769a9c | ||
|
|
59f879adf1 | ||
|
|
ebfe2a27b7 | ||
|
|
64d8956c0a | ||
|
|
68d0864f09 | ||
|
|
c4b6274d7e | ||
|
|
284f6ec190 | ||
|
|
8021144ea4 | ||
|
|
df03a94e11 |
@@ -56,6 +56,21 @@ static void setThunkVisibility(CodeGenModule &CGM, const CXXMethodDecl *MD,
|
||||
CGM.setGlobalVisibility(Fn, MD);
|
||||
}
|
||||
|
||||
static void setThunkProperties(CodeGenModule &CGM, const ThunkInfo &Thunk,
|
||||
llvm::Function *ThunkFn, bool ForVTable,
|
||||
GlobalDecl GD) {
|
||||
CGM.setFunctionLinkage(GD, ThunkFn);
|
||||
CGM.getCXXABI().setThunkLinkage(ThunkFn, ForVTable, GD,
|
||||
!Thunk.Return.isEmpty());
|
||||
|
||||
// Set the right visibility.
|
||||
const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl());
|
||||
setThunkVisibility(CGM, MD, Thunk, ThunkFn);
|
||||
|
||||
if (CGM.supportsCOMDAT() && ThunkFn->isWeakForLinker())
|
||||
ThunkFn->setComdat(CGM.getModule().getOrInsertComdat(ThunkFn->getName()));
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
static bool similar(const ABIArgInfo &infoL, CanQualType typeL,
|
||||
const ABIArgInfo &infoR, CanQualType typeR) {
|
||||
@@ -429,8 +444,7 @@ void CodeGenVTables::emitThunk(GlobalDecl GD, const ThunkInfo &Thunk,
|
||||
return;
|
||||
}
|
||||
|
||||
// Change the linkage.
|
||||
CGM.setFunctionLinkage(GD, ThunkFn);
|
||||
setThunkProperties(CGM, Thunk, ThunkFn, ForVTable, GD);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -451,16 +465,7 @@ void CodeGenVTables::emitThunk(GlobalDecl GD, const ThunkInfo &Thunk,
|
||||
CodeGenFunction(CGM).generateThunk(ThunkFn, FnInfo, GD, Thunk);
|
||||
}
|
||||
|
||||
CGM.setFunctionLinkage(GD, ThunkFn);
|
||||
CGM.getCXXABI().setThunkLinkage(ThunkFn, ForVTable, GD,
|
||||
!Thunk.Return.isEmpty());
|
||||
|
||||
// Set the right visibility.
|
||||
const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl());
|
||||
setThunkVisibility(CGM, MD, Thunk, ThunkFn);
|
||||
|
||||
if (CGM.supportsCOMDAT() && ThunkFn->isWeakForLinker())
|
||||
ThunkFn->setComdat(CGM.getModule().getOrInsertComdat(ThunkFn->getName()));
|
||||
setThunkProperties(CGM, Thunk, ThunkFn, ForVTable, GD);
|
||||
}
|
||||
|
||||
void CodeGenVTables::maybeEmitThunkForVTable(GlobalDecl GD,
|
||||
|
||||
@@ -361,6 +361,23 @@ namespace Test15 {
|
||||
// CHECK: declare void @_ZThn8_N6Test151C1fEiz
|
||||
}
|
||||
|
||||
namespace Test16 {
|
||||
struct A {
|
||||
virtual ~A();
|
||||
};
|
||||
struct B {
|
||||
virtual void foo();
|
||||
};
|
||||
struct C : public A, public B {
|
||||
void foo() {}
|
||||
};
|
||||
struct D : public C {
|
||||
~D();
|
||||
};
|
||||
D::~D() {}
|
||||
// CHECK: define linkonce_odr void @_ZThn8_N6Test161C3fooEv({{.*}}) {{.*}} comdat
|
||||
}
|
||||
|
||||
/**** The following has to go at the end of the file ****/
|
||||
|
||||
// This is from Test5:
|
||||
|
||||
@@ -1811,7 +1811,7 @@ of class templates</td>
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#295">295</a></td>
|
||||
<td>CD1</td>
|
||||
<td>cv-qualifiers on function types</td>
|
||||
<td class="svn" align="center">SVN</td>
|
||||
<td class="full" align="center">Clang 3.7</td>
|
||||
</tr>
|
||||
<tr id="296">
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#296">296</a></td>
|
||||
@@ -4681,7 +4681,7 @@ and <I>POD class</I></td>
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#777">777</a></td>
|
||||
<td>CD2</td>
|
||||
<td>Default arguments and parameter packs</td>
|
||||
<td class="svn" align="center">SVN</td>
|
||||
<td class="full" align="center">Clang 3.7</td>
|
||||
</tr>
|
||||
<tr id="778">
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#778">778</a></td>
|
||||
@@ -5503,7 +5503,7 @@ and <I>POD class</I></td>
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#948">948</a></td>
|
||||
<td>C++11</td>
|
||||
<td><TT>constexpr</TT> in <I>condition</I>s</td>
|
||||
<td class="svn" align="center">SVN</td>
|
||||
<td class="full" align="center">Clang 3.7</td>
|
||||
</tr>
|
||||
<tr class="open" id="949">
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#949">949</a></td>
|
||||
@@ -8617,7 +8617,7 @@ and <I>POD class</I></td>
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1467">1467</a></td>
|
||||
<td>DR</td>
|
||||
<td>List-initialization of aggregate from same-type object</td>
|
||||
<td class="svn" align="center">SVN (C++11 onwards)</td>
|
||||
<td class="full" align="center">Clang 3.7 (C++11 onwards)</td>
|
||||
</tr>
|
||||
<tr class="open" id="1468">
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1468">1468</a></td>
|
||||
@@ -8755,7 +8755,7 @@ and <I>POD class</I></td>
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1490">1490</a></td>
|
||||
<td>DR</td>
|
||||
<td>List-initialization from a string literal</td>
|
||||
<td class="svn" align="center">SVN (C++11 onwards)</td>
|
||||
<td class="full" align="center">Clang 3.7 (C++11 onwards)</td>
|
||||
</tr>
|
||||
<tr id="1491">
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1491">1491</a></td>
|
||||
@@ -9349,7 +9349,7 @@ and <I>POD class</I></td>
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1589">1589</a></td>
|
||||
<td>DR</td>
|
||||
<td>Ambiguous ranking of list-initialization sequences</td>
|
||||
<td class="svn" align="center">SVN (C++11 onwards)</td>
|
||||
<td class="full" align="center">Clang 3.7 (C++11 onwards)</td>
|
||||
</tr>
|
||||
<tr class="open" id="1590">
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1590">1590</a></td>
|
||||
@@ -9601,7 +9601,7 @@ and <I>POD class</I></td>
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1631">1631</a></td>
|
||||
<td>DR</td>
|
||||
<td>Incorrect overload resolution for single-element <I>initializer-list</I></td>
|
||||
<td class="svn" align="center">SVN (C++11 onwards)</td>
|
||||
<td class="full" align="center">Clang 3.7 (C++11 onwards)</td>
|
||||
</tr>
|
||||
<tr class="open" id="1632">
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1632">1632</a></td>
|
||||
@@ -10303,7 +10303,7 @@ and <I>POD class</I></td>
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1748">1748</a></td>
|
||||
<td>DR</td>
|
||||
<td>Placement new with a null pointer</td>
|
||||
<td class="svn" align="center">SVN</td>
|
||||
<td class="full" align="center">Clang 3.7</td>
|
||||
</tr>
|
||||
<tr id="1749">
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#1749">1749</a></td>
|
||||
@@ -10351,7 +10351,7 @@ and <I>POD class</I></td>
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1756">1756</a></td>
|
||||
<td>DR</td>
|
||||
<td>Direct-list-initialization of a non-class object</td>
|
||||
<td class="svn" align="center">SVN (C++11 onwards)</td>
|
||||
<td class="full" align="center">Clang 3.7 (C++11 onwards)</td>
|
||||
</tr>
|
||||
<tr id="1757">
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1757">1757</a></td>
|
||||
@@ -10363,7 +10363,7 @@ and <I>POD class</I></td>
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1758">1758</a></td>
|
||||
<td>DR</td>
|
||||
<td>Explicit conversion in copy/move list initialization</td>
|
||||
<td class="svn" align="center">SVN (C++11 onwards)</td>
|
||||
<td class="full" align="center">Clang 3.7 (C++11 onwards)</td>
|
||||
</tr>
|
||||
<tr id="1759">
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1759">1759</a></td>
|
||||
@@ -11227,7 +11227,7 @@ and <I>POD class</I></td>
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1902">1902</a></td>
|
||||
<td>DR</td>
|
||||
<td>What makes a conversion “otherwise ill-formed”?</td>
|
||||
<td class="svn" align="center">SVN</td>
|
||||
<td class="full" align="center">Clang 3.7</td>
|
||||
</tr>
|
||||
<tr class="open" id="1903">
|
||||
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1903">1903</a></td>
|
||||
|
||||
@@ -102,10 +102,10 @@ def availability(issue):
|
||||
if status == 'unknown':
|
||||
avail = 'Unknown'
|
||||
avail_style = ' class="none"'
|
||||
elif status == '3.7':
|
||||
elif status == '3.8':
|
||||
avail = 'SVN'
|
||||
avail_style = ' class="svn"'
|
||||
elif status in ('3.1', '3.2', '3.3', '3.4', '3.5', '3.6'):
|
||||
elif status in ('3.1', '3.2', '3.3', '3.4', '3.5', '3.6', '3.7'):
|
||||
avail = 'Clang %s' % status
|
||||
avail_style = ' class="full"'
|
||||
elif status == 'yes':
|
||||
|
||||
@@ -258,6 +258,7 @@ macro(add_custom_libcxx name prefix)
|
||||
LOG_CONFIGURE 1
|
||||
LOG_INSTALL 1
|
||||
)
|
||||
set_target_properties(${name} PROPERTIES EXCLUDE_FROM_ALL TRUE)
|
||||
|
||||
ExternalProject_Add_Step(${name} force-reconfigure
|
||||
DEPENDERS configure
|
||||
|
||||
@@ -90,6 +90,7 @@ static void truncateCurrentFile(void) {
|
||||
char *Copy = malloc(strlen(Filename) + 1);
|
||||
strcpy(Copy, Filename);
|
||||
__llvm_profile_recursive_mkdir(Copy);
|
||||
free(Copy);
|
||||
}
|
||||
|
||||
/* Truncate the file. Later we'll reopen and append. */
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
-*- rst -*-
|
||||
This is a collection of tests to check debugging information generated by
|
||||
compiler. This test suite can be checked out inside clang/test folder. This
|
||||
will enable 'make test' for clang to pick up these tests. Typically, test
|
||||
cases included here includes debugger commands and intended debugger output
|
||||
as comments in source file using DEBUGGER: and CHECK: as prefixes respectively.
|
||||
|
||||
For example::
|
||||
|
||||
define i32 @f1(i32 %i) nounwind ssp {
|
||||
; DEBUGGER: break f1
|
||||
; DEBUGGER: r
|
||||
; DEBUGGER: p i
|
||||
; CHECK: $1 = 42
|
||||
entry:
|
||||
}
|
||||
|
||||
is a testcase where the debugger is asked to break at function 'f1' and
|
||||
print value of argument 'i'. The expected value of 'i' is 42 in this case.
|
||||
@@ -1,32 +0,0 @@
|
||||
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
|
||||
// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out
|
||||
// RUN: %test_debuginfo %s %t.out
|
||||
// Radar 8945514
|
||||
// DEBUGGER: break 22
|
||||
// DEBUGGER: r
|
||||
// DEBUGGER: p v
|
||||
// CHECK: ${{[0-9]+}} =
|
||||
// CHECK: Data ={{.*}} 0x0{{(0*)}}
|
||||
// CHECK: Kind = 2142
|
||||
|
||||
class SVal {
|
||||
public:
|
||||
~SVal() {}
|
||||
const void* Data;
|
||||
unsigned Kind;
|
||||
};
|
||||
|
||||
void bar(SVal &v) {}
|
||||
class A {
|
||||
public:
|
||||
void foo(SVal v) { bar(v); }
|
||||
};
|
||||
|
||||
int main() {
|
||||
SVal v;
|
||||
v.Data = 0;
|
||||
v.Kind = 2142;
|
||||
A a;
|
||||
a.foo(v);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
|
||||
// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation
|
||||
// RUN: %test_debuginfo %s %t.out
|
||||
|
||||
// REQUIRES: system-darwin
|
||||
|
||||
// DEBUGGER: break 24
|
||||
// DEBUGGER: r
|
||||
// DEBUGGER: p result
|
||||
// CHECK: ${{[0-9]}} = 42
|
||||
|
||||
void doBlock(void (^block)(void))
|
||||
{
|
||||
block();
|
||||
}
|
||||
|
||||
int I(int n)
|
||||
{
|
||||
__block int result;
|
||||
int i = 2;
|
||||
doBlock(^{
|
||||
result = n;
|
||||
});
|
||||
return result + i; /* Check value of 'result' */
|
||||
}
|
||||
|
||||
|
||||
int main (int argc, const char * argv[]) {
|
||||
return I(42);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
|
||||
// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation
|
||||
// RUN: %test_debuginfo %s %t.out
|
||||
|
||||
// REQUIRES: system-darwin
|
||||
// Radar 9279956
|
||||
|
||||
// DEBUGGER: break 31
|
||||
// DEBUGGER: r
|
||||
// DEBUGGER: p m2
|
||||
// CHECK: ${{[0-9]}} = 1
|
||||
// DEBUGGER: p dbTransaction
|
||||
// CHECK: ${{[0-9]}} = 0
|
||||
// DEBUGGER: p master
|
||||
// CHECK: ${{[0-9]}} = 0
|
||||
|
||||
#include <Cocoa/Cocoa.h>
|
||||
|
||||
extern void foo(void(^)(void));
|
||||
|
||||
@interface A:NSObject @end
|
||||
@implementation A
|
||||
- (void) helper {
|
||||
int master = 0;
|
||||
__block int m2 = 0;
|
||||
__block int dbTransaction = 0;
|
||||
int (^x)(void) = ^(void) { (void) self;
|
||||
(void) master;
|
||||
(void) dbTransaction;
|
||||
m2++;
|
||||
return m2;
|
||||
};
|
||||
master = x();
|
||||
}
|
||||
@end
|
||||
|
||||
void foo(void(^x)(void)) {}
|
||||
|
||||
int main() {
|
||||
A *a = [A alloc];
|
||||
[a helper];
|
||||
return 0;
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
|
||||
// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out
|
||||
// RUN: %test_debuginfo %s %t.out
|
||||
|
||||
|
||||
// DEBUGGER: break 14
|
||||
// DEBUGGER: r
|
||||
// DEBUGGER: p *this
|
||||
// CHECK-NEXT-NOT: Cannot access memory at address
|
||||
|
||||
class A {
|
||||
public:
|
||||
A() : zero(0), data(42)
|
||||
{
|
||||
}
|
||||
private:
|
||||
int zero;
|
||||
int data;
|
||||
};
|
||||
|
||||
int main() {
|
||||
A a;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
// This test case checks debug info during register moves for an argument.
|
||||
// RUN: %clang %target_itanium_abi_host_triple -arch x86_64 -mllvm -fast-isel=false %s -c -o %t.o
|
||||
// RUN: %clang %target_itanium_abi_host_triple -arch x86_64 %t.o -o %t.out
|
||||
// RUN: %test_debuginfo %s %t.out
|
||||
//
|
||||
// Radar 8412415
|
||||
|
||||
struct _mtx
|
||||
{
|
||||
long unsigned int ptr;
|
||||
int waiters;
|
||||
struct {
|
||||
int tag;
|
||||
int pad;
|
||||
} mtxi;
|
||||
};
|
||||
|
||||
|
||||
int foobar(struct _mtx *mutex) {
|
||||
int r = 1;
|
||||
int l = 0;
|
||||
int j = 0;
|
||||
do {
|
||||
if (mutex->waiters) {
|
||||
r = 2;
|
||||
}
|
||||
j = bar(r, l);
|
||||
++l;
|
||||
} while (l < j);
|
||||
return r + j;
|
||||
}
|
||||
|
||||
int bar(int i, int j) {
|
||||
return i + j;
|
||||
}
|
||||
|
||||
int main() {
|
||||
struct _mtx m;
|
||||
m.waiters = 0;
|
||||
return foobar(&m);
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
|
||||
// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation
|
||||
// RUN: %test_debuginfo %s %t.out
|
||||
//
|
||||
// REQUIRES: system-darwin
|
||||
// Radar 8757124
|
||||
|
||||
// DEBUGGER: break 25
|
||||
// DEBUGGER: r
|
||||
// DEBUGGER: po thing
|
||||
// CHECK: aaa
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
int main (int argc, const char * argv[]) {
|
||||
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSArray *things = [NSArray arrayWithObjects:@"one", @"two", @"three" , nil];
|
||||
for (NSString *thing in things) {
|
||||
NSLog (@"%@", thing);
|
||||
}
|
||||
|
||||
things = [NSArray arrayWithObjects:@"aaa", @"bbb", @"ccc" , nil];
|
||||
for (NSString *thing in things) {
|
||||
NSLog (@"%@", thing);
|
||||
}
|
||||
[pool release];
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
|
||||
// RUN: %test_debuginfo %s %t.o
|
||||
// Radar 9168773
|
||||
|
||||
// DEBUGGER: ptype A
|
||||
// Work around a gdb bug where it believes that a class is a
|
||||
// struct if there aren't any methods - even though it's tagged
|
||||
// as a class.
|
||||
// CHECK: type = {{struct|class}} A {
|
||||
// CHECK-NEXT: {{(public:){0,1}}}
|
||||
// CHECK-NEXT: int MyData;
|
||||
// CHECK-NEXT: }
|
||||
class A;
|
||||
class B {
|
||||
public:
|
||||
void foo(const A *p);
|
||||
};
|
||||
|
||||
B iEntry;
|
||||
|
||||
class A {
|
||||
public:
|
||||
int MyData;
|
||||
};
|
||||
|
||||
A irp;
|
||||
|
||||
@@ -1,153 +0,0 @@
|
||||
#!/bin/env python
|
||||
"""
|
||||
A gdb-compatible frontend for lldb that implements just enough
|
||||
commands to run the tests in the debuginfo-tests repository with lldb.
|
||||
"""
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Auto-detect lldb python module.
|
||||
import commands, platform, os, sys
|
||||
try:
|
||||
# Just try for LLDB in case PYTHONPATH is already correctly setup.
|
||||
import lldb
|
||||
except ImportError:
|
||||
lldb_python_dirs = list()
|
||||
# lldb is not in the PYTHONPATH, try some defaults for the current platform.
|
||||
platform_system = platform.system()
|
||||
if platform_system == 'Darwin':
|
||||
# On Darwin, try the currently selected Xcode directory
|
||||
xcode_dir = commands.getoutput("xcode-select --print-path")
|
||||
if xcode_dir:
|
||||
lldb_python_dirs.append(os.path.realpath(xcode_dir +
|
||||
'/../SharedFrameworks/LLDB.framework/Resources/Python'))
|
||||
lldb_python_dirs.append(xcode_dir +
|
||||
'/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
|
||||
lldb_python_dirs.append(
|
||||
'/System/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
|
||||
success = False
|
||||
for lldb_python_dir in lldb_python_dirs:
|
||||
if os.path.exists(lldb_python_dir):
|
||||
if not (sys.path.__contains__(lldb_python_dir)):
|
||||
sys.path.append(lldb_python_dir)
|
||||
try:
|
||||
import lldb
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
print 'imported lldb from: "%s"' % (lldb_python_dir)
|
||||
success = True
|
||||
break
|
||||
if not success:
|
||||
print "error: couldn't locate the 'lldb' module, please set PYTHONPATH correctly"
|
||||
sys.exit(1)
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# Command line option handling.
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--quiet', '-q', action="store_true", help='ignored')
|
||||
parser.add_argument('-batch', action="store_true",
|
||||
help='exit after processing comand line')
|
||||
parser.add_argument('-n', action="store_true", help='ignore .lldb file')
|
||||
parser.add_argument('-x', dest='script', type=file, help='execute commands from file')
|
||||
parser.add_argument("target", help="the program to debug")
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
# Create a new debugger instance.
|
||||
debugger = lldb.SBDebugger.Create()
|
||||
debugger.SkipLLDBInitFiles(args.n)
|
||||
|
||||
# Don't return from lldb function calls until the process stops.
|
||||
debugger.SetAsync(False)
|
||||
|
||||
# Create a target from a file and arch.
|
||||
arch = os.popen("file "+args.target).read().split()[-1]
|
||||
target = debugger.CreateTargetWithFileAndArch(args.target, arch)
|
||||
|
||||
if not target:
|
||||
print "Could not create target", args.target
|
||||
sys.exit(1)
|
||||
|
||||
if not args.script:
|
||||
print "Interactive mode is not implemented."
|
||||
sys.exit(1)
|
||||
|
||||
import re
|
||||
for command in args.script:
|
||||
# Strip newline and whitespaces and split into words.
|
||||
cmd = command[:-1].strip().split()
|
||||
if not cmd:
|
||||
continue
|
||||
|
||||
print '> %s'% command[:-1]
|
||||
|
||||
try:
|
||||
if re.match('^r|(run)$', cmd[0]):
|
||||
error = lldb.SBError()
|
||||
launchinfo = lldb.SBLaunchInfo([])
|
||||
launchinfo.SetWorkingDirectory(os.getcwd())
|
||||
process = target.Launch(launchinfo, error)
|
||||
print error
|
||||
if not process or error.fail:
|
||||
state = process.GetState()
|
||||
print "State = %d" % state
|
||||
print """
|
||||
ERROR: Could not launch process.
|
||||
NOTE: There are several reasons why this may happen:
|
||||
* Root needs to run "DevToolsSecurity --enable".
|
||||
* Older versions of lldb cannot launch more than one process simultaneously.
|
||||
"""
|
||||
sys.exit(1)
|
||||
|
||||
elif re.match('^b|(break)$', cmd[0]) and len(cmd) == 2:
|
||||
if re.match('[0-9]+', cmd[1]):
|
||||
# b line
|
||||
mainfile = target.FindFunctions('main')[0].compile_unit.file
|
||||
print target.BreakpointCreateByLocation(mainfile, int(cmd[1]))
|
||||
else:
|
||||
# b file:line
|
||||
file, line = cmd[1].split(':')
|
||||
print target.BreakpointCreateByLocation(file, int(line))
|
||||
|
||||
elif re.match('^ptype$', cmd[0]) and len(cmd) == 2:
|
||||
# GDB's ptype has multiple incarnations depending on its
|
||||
# argument (global variable, function, type). The definition
|
||||
# here is for looking up the signature of a function and only
|
||||
# if that fails it looks for a type with that name.
|
||||
# Type lookup in LLDB would be "image lookup --type".
|
||||
for elem in target.FindFunctions(cmd[1]):
|
||||
print elem.function.type
|
||||
continue
|
||||
print target.FindFirstType(cmd[1])
|
||||
|
||||
elif re.match('^po$', cmd[0]) and len(cmd) > 1:
|
||||
try:
|
||||
opts = lldb.SBExpressionOptions()
|
||||
opts.SetFetchDynamicValue(True)
|
||||
opts.SetCoerceResultToId(True)
|
||||
print target.EvaluateExpression(' '.join(cmd[1:]), opts)
|
||||
except:
|
||||
# FIXME: This is a fallback path for the lab.llvm.org
|
||||
# buildbot running OS X 10.7; it should be removed.
|
||||
thread = process.GetThreadAtIndex(0)
|
||||
frame = thread.GetFrameAtIndex(0)
|
||||
print frame.EvaluateExpression(' '.join(cmd[1:]))
|
||||
|
||||
elif re.match('^p|(print)$', cmd[0]) and len(cmd) > 1:
|
||||
thread = process.GetThreadAtIndex(0)
|
||||
frame = thread.GetFrameAtIndex(0)
|
||||
print frame.EvaluateExpression(' '.join(cmd[1:]))
|
||||
|
||||
elif re.match('^q|(quit)$', cmd[0]):
|
||||
sys.exit(0)
|
||||
|
||||
else:
|
||||
print debugger.HandleCommand(' '.join(cmd))
|
||||
|
||||
except SystemExit:
|
||||
lldb.SBDebugger_Terminate()
|
||||
raise
|
||||
except:
|
||||
print 'Could not handle the command "%s"' % ' '.join(cmd)
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
|
||||
// RUN: %test_debuginfo %s %t.o
|
||||
// Radar 9440721
|
||||
// If debug info for my_number() is emitted outside function foo's scope
|
||||
// then a debugger may not be able to handle it. At least one version of
|
||||
// gdb crashes in such cases.
|
||||
|
||||
// DEBUGGER: ptype foo
|
||||
// CHECK: int (void)
|
||||
|
||||
int foo() {
|
||||
struct Local {
|
||||
static int my_number() {
|
||||
return 42;
|
||||
}
|
||||
};
|
||||
|
||||
int i = 0;
|
||||
i = Local::my_number();
|
||||
return i + 1;
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
|
||||
// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out
|
||||
// RUN: %test_debuginfo %s %t.out
|
||||
// Radar 8775834
|
||||
// DEBUGGER: break 62
|
||||
// DEBUGGER: r
|
||||
// DEBUGGER: p a
|
||||
// CHECK: ${{[0-9]+}} =
|
||||
// LLDB does not print artificial members.
|
||||
// CHECK: {{(_vptr\$A =)?.*}}m_int = 12
|
||||
|
||||
class A
|
||||
{
|
||||
public:
|
||||
A (int i=0);
|
||||
A (const A& rhs);
|
||||
const A&
|
||||
operator= (const A& rhs);
|
||||
virtual ~A() {}
|
||||
|
||||
int get_int();
|
||||
|
||||
protected:
|
||||
int m_int;
|
||||
};
|
||||
|
||||
A::A (int i) :
|
||||
m_int(i)
|
||||
{
|
||||
}
|
||||
|
||||
A::A (const A& rhs) :
|
||||
m_int (rhs.m_int)
|
||||
{
|
||||
}
|
||||
|
||||
const A &
|
||||
A::operator =(const A& rhs)
|
||||
{
|
||||
m_int = rhs.m_int;
|
||||
return *this;
|
||||
}
|
||||
|
||||
int A::get_int()
|
||||
{
|
||||
return m_int;
|
||||
}
|
||||
|
||||
class B
|
||||
{
|
||||
public:
|
||||
B () {}
|
||||
|
||||
A AInstance();
|
||||
};
|
||||
|
||||
A
|
||||
B::AInstance()
|
||||
{
|
||||
A a(12);
|
||||
return a;
|
||||
}
|
||||
|
||||
int main (int argc, char const *argv[])
|
||||
{
|
||||
B b;
|
||||
int return_val = b.AInstance().get_int();
|
||||
|
||||
A a(b.AInstance());
|
||||
return return_val;
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -o %t -c
|
||||
// RUN: %clangxx %target_itanium_abi_host_triple %t -o %t.out
|
||||
// RUN: %test_debuginfo %s %t.out
|
||||
|
||||
// FIXME: LLDB finds the wrong symbol for "C". rdar://problem/14933867
|
||||
// XFAIL: darwin
|
||||
|
||||
// DEBUGGER: delete breakpoints
|
||||
// DEBUGGER: break static-member.cpp:33
|
||||
// DEBUGGER: r
|
||||
// DEBUGGER: ptype C
|
||||
// CHECK: {{struct|class}} C {
|
||||
// CHECK: static const int a;
|
||||
// CHECK-NEXT: static int b;
|
||||
// CHECK-NEXT: static int c;
|
||||
// CHECK-NEXT: int d;
|
||||
// CHECK-NEXT: }
|
||||
// DEBUGGER: p C::a
|
||||
// CHECK: ${{[0-9]}} = 4
|
||||
// DEBUGGER: p C::c
|
||||
// CHECK: ${{[0-9]}} = 15
|
||||
|
||||
// PR14471, PR14734
|
||||
|
||||
class C {
|
||||
public:
|
||||
const static int a = 4;
|
||||
static int b;
|
||||
static int c;
|
||||
int d;
|
||||
};
|
||||
|
||||
int C::c = 15;
|
||||
const int C::a;
|
||||
|
||||
int main() {
|
||||
C instance_C;
|
||||
return C::a;
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -o %t -c
|
||||
// RUN: %clangxx %target_itanium_abi_host_triple %t -o %t.out
|
||||
// RUN: %test_debuginfo %s %t.out
|
||||
|
||||
// DEBUGGER: delete breakpoints
|
||||
// DEBUGGER: break static-member.cpp:33
|
||||
// DEBUGGER: r
|
||||
// DEBUGGER: ptype MyClass
|
||||
// CHECK: {{struct|class}} MyClass {
|
||||
// CHECK: static const int a;
|
||||
// CHECK-NEXT: static int b;
|
||||
// CHECK-NEXT: static int c;
|
||||
// CHECK-NEXT: int d;
|
||||
// CHECK-NEXT: }
|
||||
// DEBUGGER: p MyClass::a
|
||||
// CHECK: ${{[0-9]}} = 4
|
||||
// DEBUGGER: p MyClass::c
|
||||
// CHECK: ${{[0-9]}} = 15
|
||||
|
||||
// PR14471, PR14734
|
||||
|
||||
class MyClass {
|
||||
public:
|
||||
const static int a = 4;
|
||||
static int b;
|
||||
static int c;
|
||||
int d;
|
||||
};
|
||||
|
||||
int MyClass::c = 15;
|
||||
const int MyClass::a;
|
||||
|
||||
int main() {
|
||||
MyClass instance_MyClass;
|
||||
return MyClass::a;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
N: Peter Collingbourne
|
||||
E: peter@pcc.me.uk
|
||||
@@ -1,64 +0,0 @@
|
||||
==============================================================================
|
||||
libclc License
|
||||
==============================================================================
|
||||
|
||||
The libclc library is dual licensed under both the University of Illinois
|
||||
"BSD-Like" license and the MIT license. As a user of this code you may choose
|
||||
to use it under either license. As a contributor, you agree to allow your code
|
||||
to be used under both.
|
||||
|
||||
Full text of the relevant licenses is included below.
|
||||
|
||||
==============================================================================
|
||||
|
||||
Copyright (c) 2011-2014 by the contributors listed in CREDITS.TXT
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal with
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimers.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimers in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* The names of the contributors may not be used to endorse or promote
|
||||
products derived from this Software without specific prior written
|
||||
permission.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
|
||||
SOFTWARE.
|
||||
|
||||
==============================================================================
|
||||
|
||||
Copyright (c) 2011-2014 by the contributors listed in CREDITS.TXT
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -1,52 +0,0 @@
|
||||
libclc
|
||||
------
|
||||
|
||||
libclc is an open source, BSD licensed implementation of the library
|
||||
requirements of the OpenCL C programming language, as specified by the
|
||||
OpenCL 1.1 Specification. The following sections of the specification
|
||||
impose library requirements:
|
||||
|
||||
* 6.1: Supported Data Types
|
||||
* 6.2.3: Explicit Conversions
|
||||
* 6.2.4.2: Reinterpreting Types Using as_type() and as_typen()
|
||||
* 6.9: Preprocessor Directives and Macros
|
||||
* 6.11: Built-in Functions
|
||||
* 9.3: Double Precision Floating-Point
|
||||
* 9.4: 64-bit Atomics
|
||||
* 9.5: Writing to 3D image memory objects
|
||||
* 9.6: Half Precision Floating-Point
|
||||
|
||||
libclc is intended to be used with the Clang compiler's OpenCL frontend.
|
||||
|
||||
libclc is designed to be portable and extensible. To this end, it provides
|
||||
generic implementations of most library requirements, allowing the target
|
||||
to override the generic implementation at the granularity of individual
|
||||
functions.
|
||||
|
||||
libclc currently only supports the PTX target, but support for more
|
||||
targets is welcome.
|
||||
|
||||
Compiling and installing with Make
|
||||
----------------------------------
|
||||
|
||||
$ ./configure.py --with-llvm-config=/path/to/llvm-config && make
|
||||
$ make install
|
||||
|
||||
Note you can use the DESTDIR Makefile variable to do staged installs.
|
||||
|
||||
$ make install DESTDIR=/path/for/staged/install
|
||||
|
||||
Compiling and installing with Ninja
|
||||
-----------------------------------
|
||||
|
||||
$ ./configure.py -g ninja --with-llvm-config=/path/to/llvm-config && ninja
|
||||
$ ninja install
|
||||
|
||||
Note you can use the DESTDIR environment variable to do staged installs.
|
||||
|
||||
$ DESTDIR=/path/for/staged/install ninja install
|
||||
|
||||
Website
|
||||
-------
|
||||
|
||||
http://www.pcc.me.uk/~peter/libclc/
|
||||
@@ -1,100 +0,0 @@
|
||||
import ninja_syntax
|
||||
import os
|
||||
|
||||
# Simple meta-build system.
|
||||
|
||||
class Make(object):
|
||||
def __init__(self):
|
||||
self.output = open(self.output_filename(), 'w')
|
||||
self.rules = {}
|
||||
self.rule_text = ''
|
||||
self.all_targets = []
|
||||
self.default_targets = []
|
||||
self.clean_files = []
|
||||
self.distclean_files = []
|
||||
self.output.write("""all::
|
||||
|
||||
ifndef VERBOSE
|
||||
Verb = @
|
||||
endif
|
||||
|
||||
""")
|
||||
|
||||
def output_filename(self):
|
||||
return 'Makefile'
|
||||
|
||||
def rule(self, name, command, description=None, depfile=None,
|
||||
generator=False):
|
||||
self.rules[name] = {'command': command, 'description': description,
|
||||
'depfile': depfile, 'generator': generator}
|
||||
|
||||
def build(self, output, rule, inputs=[], implicit=[], order_only=[]):
|
||||
inputs = self._as_list(inputs)
|
||||
implicit = self._as_list(implicit)
|
||||
order_only = self._as_list(order_only)
|
||||
|
||||
output_dir = os.path.dirname(output)
|
||||
if output_dir != '' and not os.path.isdir(output_dir):
|
||||
os.makedirs(output_dir)
|
||||
|
||||
dollar_in = ' '.join(inputs)
|
||||
subst = lambda text: text.replace('$in', dollar_in).replace('$out', output)
|
||||
|
||||
deps = ' '.join(inputs + implicit)
|
||||
if order_only:
|
||||
deps += ' | '
|
||||
deps += ' '.join(order_only)
|
||||
self.output.write('%s: %s\n' % (output, deps))
|
||||
|
||||
r = self.rules[rule]
|
||||
command = subst(r['command'])
|
||||
if r['description']:
|
||||
desc = subst(r['description'])
|
||||
self.output.write('\t@echo %s\n\t$(Verb) %s\n' % (desc, command))
|
||||
else:
|
||||
self.output.write('\t%s\n' % command)
|
||||
if r['depfile']:
|
||||
depfile = subst(r['depfile'])
|
||||
self.output.write('-include '+depfile+'\n')
|
||||
self.output.write('\n')
|
||||
|
||||
self.all_targets.append(output)
|
||||
if r['generator']:
|
||||
self.distclean_files.append(output)
|
||||
if r['depfile']:
|
||||
self.distclean_files.append(depfile)
|
||||
else:
|
||||
self.clean_files.append(output)
|
||||
if r['depfile']:
|
||||
self.distclean_files.append(depfile)
|
||||
|
||||
|
||||
def _as_list(self, input):
|
||||
if isinstance(input, list):
|
||||
return input
|
||||
return [input]
|
||||
|
||||
def default(self, paths):
|
||||
self.default_targets += self._as_list(paths)
|
||||
|
||||
def finish(self):
|
||||
self.output.write('all:: %s\n\n' % ' '.join(self.default_targets or self.all_targets))
|
||||
self.output.write('clean: \n\trm -f %s\n\n' % ' '.join(self.clean_files))
|
||||
self.output.write('distclean: clean\n\trm -f %s\n' % ' '.join(self.distclean_files))
|
||||
|
||||
class Ninja(ninja_syntax.Writer):
|
||||
def __init__(self):
|
||||
ninja_syntax.Writer.__init__(self, open(self.output_filename(), 'w'))
|
||||
|
||||
def output_filename(self):
|
||||
return 'build.ninja'
|
||||
|
||||
def finish(self):
|
||||
pass
|
||||
|
||||
def from_name(name):
|
||||
if name == 'make':
|
||||
return Make()
|
||||
if name == 'ninja':
|
||||
return Ninja()
|
||||
raise LookupError, 'unknown generator: %s; supported generators are make and ninja' % name
|
||||
@@ -1,118 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
"""Python module for generating .ninja files.
|
||||
|
||||
Note that this is emphatically not a required piece of Ninja; it's
|
||||
just a helpful utility for build-file-generation systems that already
|
||||
use Python.
|
||||
"""
|
||||
|
||||
import textwrap
|
||||
import re
|
||||
|
||||
class Writer(object):
|
||||
def __init__(self, output, width=78):
|
||||
self.output = output
|
||||
self.width = width
|
||||
|
||||
def newline(self):
|
||||
self.output.write('\n')
|
||||
|
||||
def comment(self, text):
|
||||
for line in textwrap.wrap(text, self.width - 2):
|
||||
self.output.write('# ' + line + '\n')
|
||||
|
||||
def variable(self, key, value, indent=0):
|
||||
if value is None:
|
||||
return
|
||||
if isinstance(value, list):
|
||||
value = ' '.join(value)
|
||||
self._line('%s = %s' % (key, value), indent)
|
||||
|
||||
def rule(self, name, command, description=None, depfile=None,
|
||||
generator=False):
|
||||
self._line('rule %s' % name)
|
||||
self.variable('command', escape(command), indent=1)
|
||||
if description:
|
||||
self.variable('description', description, indent=1)
|
||||
if depfile:
|
||||
self.variable('depfile', depfile, indent=1)
|
||||
if generator:
|
||||
self.variable('generator', '1', indent=1)
|
||||
|
||||
def build(self, outputs, rule, inputs=None, implicit=None, order_only=None,
|
||||
variables=None):
|
||||
outputs = self._as_list(outputs)
|
||||
all_inputs = self._as_list(inputs)[:]
|
||||
|
||||
if implicit:
|
||||
all_inputs.append('|')
|
||||
all_inputs.extend(self._as_list(implicit))
|
||||
if order_only:
|
||||
all_inputs.append('||')
|
||||
all_inputs.extend(self._as_list(order_only))
|
||||
|
||||
self._line('build %s: %s %s' % (' '.join(outputs),
|
||||
rule,
|
||||
' '.join(all_inputs)))
|
||||
|
||||
if variables:
|
||||
for key, val in variables:
|
||||
self.variable(key, val, indent=1)
|
||||
|
||||
return outputs
|
||||
|
||||
def include(self, path):
|
||||
self._line('include %s' % path)
|
||||
|
||||
def subninja(self, path):
|
||||
self._line('subninja %s' % path)
|
||||
|
||||
def default(self, paths):
|
||||
self._line('default %s' % ' '.join(self._as_list(paths)))
|
||||
|
||||
def _line(self, text, indent=0):
|
||||
"""Write 'text' word-wrapped at self.width characters."""
|
||||
leading_space = ' ' * indent
|
||||
while len(text) > self.width:
|
||||
# The text is too wide; wrap if possible.
|
||||
|
||||
# Find the rightmost space that would obey our width constraint.
|
||||
available_space = self.width - len(leading_space) - len(' $')
|
||||
space = text.rfind(' ', 0, available_space)
|
||||
if space < 0:
|
||||
# No such space; just use the first space we can find.
|
||||
space = text.find(' ', available_space)
|
||||
if space < 0:
|
||||
# Give up on breaking.
|
||||
break
|
||||
|
||||
self.output.write(leading_space + text[0:space] + ' $\n')
|
||||
text = text[space+1:]
|
||||
|
||||
# Subsequent lines are continuations, so indent them.
|
||||
leading_space = ' ' * (indent+2)
|
||||
|
||||
self.output.write(leading_space + text + '\n')
|
||||
|
||||
def _as_list(self, input):
|
||||
if input is None:
|
||||
return []
|
||||
if isinstance(input, list):
|
||||
return input
|
||||
return [input]
|
||||
|
||||
|
||||
def escape(string):
|
||||
"""Escape a string such that Makefile and shell variables are
|
||||
correctly escaped for use in a Ninja file.
|
||||
"""
|
||||
assert '\n' not in string, 'Ninja syntax does not allow newlines'
|
||||
# We only have one special metacharacter: '$'.
|
||||
|
||||
# We should leave $in and $out untouched.
|
||||
# Just look for makefile/shell style substitutions
|
||||
return re.sub(r'(\$[{(][a-z_]+[})])',
|
||||
r'$\1',
|
||||
string,
|
||||
flags=re.IGNORECASE)
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
clang -target nvptx--nvidiacl -Iptx-nvidiacl/include -Igeneric/include -Xclang -mlink-bitcode-file -Xclang nvptx--nvidiacl/lib/builtins.bc -include clc/clc.h -Dcl_clang_storage_class_specifiers -Dcl_khr_fp64 "$@"
|
||||
@@ -1,282 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
def c_compiler_rule(b, name, description, compiler, flags):
|
||||
command = "%s -MMD -MF $out.d %s -c -o $out $in" % (compiler, flags)
|
||||
b.rule(name, command, description + " $out", depfile="$out.d")
|
||||
|
||||
version_major = 0;
|
||||
version_minor = 1;
|
||||
version_patch = 0;
|
||||
|
||||
from optparse import OptionParser
|
||||
import os
|
||||
import string
|
||||
from subprocess import *
|
||||
import sys
|
||||
|
||||
srcdir = os.path.dirname(sys.argv[0])
|
||||
|
||||
sys.path.insert(0, os.path.join(srcdir, 'build'))
|
||||
import metabuild
|
||||
|
||||
p = OptionParser()
|
||||
p.add_option('--with-llvm-config', metavar='PATH',
|
||||
help='use given llvm-config script')
|
||||
p.add_option('--with-cxx-compiler', metavar='PATH',
|
||||
help='use given C++ compiler')
|
||||
p.add_option('--prefix', metavar='PATH',
|
||||
help='install to given prefix')
|
||||
p.add_option('--libexecdir', metavar='PATH',
|
||||
help='install *.bc to given dir')
|
||||
p.add_option('--includedir', metavar='PATH',
|
||||
help='install include files to given dir')
|
||||
p.add_option('--pkgconfigdir', metavar='PATH',
|
||||
help='install clc.pc to given dir')
|
||||
p.add_option('-g', metavar='GENERATOR', default='make',
|
||||
help='use given generator (default: make)')
|
||||
p.add_option('--enable-runtime-subnormal', action="store_true", default=False,
|
||||
help='Allow runtimes to choose subnormal support')
|
||||
(options, args) = p.parse_args()
|
||||
|
||||
llvm_config_exe = options.with_llvm_config or "llvm-config"
|
||||
|
||||
prefix = options.prefix
|
||||
if not prefix:
|
||||
prefix = '/usr/local'
|
||||
|
||||
libexecdir = options.libexecdir
|
||||
if not libexecdir:
|
||||
libexecdir = os.path.join(prefix, 'lib/clc')
|
||||
|
||||
includedir = options.includedir
|
||||
if not includedir:
|
||||
includedir = os.path.join(prefix, 'include')
|
||||
|
||||
pkgconfigdir = options.pkgconfigdir
|
||||
if not pkgconfigdir:
|
||||
pkgconfigdir = os.path.join(prefix, 'share/pkgconfig')
|
||||
|
||||
def llvm_config(args):
|
||||
try:
|
||||
proc = Popen([llvm_config_exe] + args, stdout=PIPE)
|
||||
return proc.communicate()[0].rstrip().replace('\n', ' ')
|
||||
except OSError:
|
||||
print "Error executing llvm-config."
|
||||
print "Please ensure that llvm-config is in your $PATH, or use --with-llvm-config."
|
||||
sys.exit(1)
|
||||
|
||||
llvm_version = string.split(string.replace(llvm_config(['--version']), 'svn', ''), '.')
|
||||
if (int(llvm_version[0]) != 3 and int(llvm_version[1]) != 6):
|
||||
print "libclc requires LLVM 3.6"
|
||||
sys.exit(1)
|
||||
|
||||
llvm_string_version = 'LLVM' + llvm_version[0] + '.' + llvm_version[1]
|
||||
|
||||
llvm_system_libs = llvm_config(['--system-libs'])
|
||||
llvm_bindir = llvm_config(['--bindir'])
|
||||
llvm_core_libs = llvm_config(['--libs', 'core', 'bitreader', 'bitwriter']) + ' ' + \
|
||||
llvm_system_libs + ' ' + \
|
||||
llvm_config(['--ldflags'])
|
||||
llvm_cxxflags = llvm_config(['--cxxflags']) + ' -fno-exceptions -fno-rtti'
|
||||
llvm_libdir = llvm_config(['--libdir'])
|
||||
|
||||
llvm_clang = os.path.join(llvm_bindir, 'clang')
|
||||
llvm_link = os.path.join(llvm_bindir, 'llvm-link')
|
||||
llvm_opt = os.path.join(llvm_bindir, 'opt')
|
||||
|
||||
cxx_compiler = options.with_cxx_compiler
|
||||
if not cxx_compiler:
|
||||
cxx_compiler = os.path.join(llvm_bindir, 'clang++')
|
||||
|
||||
available_targets = {
|
||||
'r600--' : { 'devices' :
|
||||
[{'gpu' : 'cedar', 'aliases' : ['palm', 'sumo', 'sumo2', 'redwood', 'juniper']},
|
||||
{'gpu' : 'cypress', 'aliases' : ['hemlock']},
|
||||
{'gpu' : 'barts', 'aliases' : ['turks', 'caicos']},
|
||||
{'gpu' : 'cayman', 'aliases' : ['aruba']}]},
|
||||
'amdgcn--': { 'devices' :
|
||||
[{'gpu' : 'tahiti', 'aliases' : ['pitcairn', 'verde', 'oland', 'hainan', 'bonaire', 'kabini', 'kaveri', 'hawaii','mullins']}]},
|
||||
'nvptx--' : { 'devices' : [{'gpu' : '', 'aliases' : []}]},
|
||||
'nvptx64--' : { 'devices' : [{'gpu' : '', 'aliases' : []}] },
|
||||
'nvptx--nvidiacl' : { 'devices' : [{'gpu' : '', 'aliases' : []}] },
|
||||
'nvptx64--nvidiacl' : { 'devices' : [{'gpu' : '', 'aliases' : []}] }
|
||||
}
|
||||
|
||||
default_targets = ['nvptx--nvidiacl', 'nvptx64--nvidiacl', 'r600--', 'amdgcn--']
|
||||
|
||||
targets = args
|
||||
if not targets:
|
||||
targets = default_targets
|
||||
|
||||
b = metabuild.from_name(options.g)
|
||||
|
||||
b.rule("LLVM_AS", "%s -o $out $in" % os.path.join(llvm_bindir, "llvm-as"),
|
||||
'LLVM-AS $out')
|
||||
b.rule("LLVM_LINK", command = llvm_link + " -o $out $in",
|
||||
description = 'LLVM-LINK $out')
|
||||
b.rule("OPT", command = llvm_opt + " -O3 -o $out $in",
|
||||
description = 'OPT $out')
|
||||
|
||||
c_compiler_rule(b, "LLVM_TOOL_CXX", 'CXX', cxx_compiler, llvm_cxxflags)
|
||||
b.rule("LLVM_TOOL_LINK", cxx_compiler + " -o $out $in %s" % llvm_core_libs + " -Wl,-rpath %s" % llvm_libdir, 'LINK $out')
|
||||
|
||||
prepare_builtins = os.path.join('utils', 'prepare-builtins')
|
||||
b.build(os.path.join('utils', 'prepare-builtins.o'), "LLVM_TOOL_CXX",
|
||||
os.path.join(srcdir, 'utils', 'prepare-builtins.cpp'))
|
||||
b.build(prepare_builtins, "LLVM_TOOL_LINK",
|
||||
os.path.join('utils', 'prepare-builtins.o'))
|
||||
|
||||
b.rule("PREPARE_BUILTINS", "%s -o $out $in" % prepare_builtins,
|
||||
'PREPARE-BUILTINS $out')
|
||||
b.rule("PYTHON_GEN", "python < $in > $out", "PYTHON_GEN $out")
|
||||
b.build('generic/lib/convert.cl', "PYTHON_GEN", ['generic/lib/gen_convert.py'])
|
||||
|
||||
manifest_deps = set([sys.argv[0], os.path.join(srcdir, 'build', 'metabuild.py'),
|
||||
os.path.join(srcdir, 'build', 'ninja_syntax.py')])
|
||||
|
||||
install_files_bc = []
|
||||
install_deps = []
|
||||
|
||||
# Create rules for subnormal helper objects
|
||||
for src in ['subnormal_disable.ll', 'subnormal_use_default.ll']:
|
||||
obj_name = src[:-2] + 'bc'
|
||||
obj = os.path.join('generic--', 'lib', obj_name)
|
||||
src_file = os.path.join('generic', 'lib', src)
|
||||
b.build(obj, 'LLVM_AS', src_file)
|
||||
b.default(obj)
|
||||
install_files_bc.append((obj, obj))
|
||||
install_deps.append(obj)
|
||||
|
||||
# Create libclc.pc
|
||||
clc = open('libclc.pc', 'w')
|
||||
clc.write('includedir=%(inc)s\nlibexecdir=%(lib)s\n\nName: libclc\nDescription: Library requirements of the OpenCL C programming language\nVersion: %(maj)s.%(min)s.%(pat)s\nCflags: -I${includedir}\nLibs: -L${libexecdir}' %
|
||||
{'inc': includedir, 'lib': libexecdir, 'maj': version_major, 'min': version_minor, 'pat': version_patch})
|
||||
clc.close()
|
||||
|
||||
for target in targets:
|
||||
(t_arch, t_vendor, t_os) = target.split('-')
|
||||
archs = [t_arch]
|
||||
if t_arch == 'nvptx' or t_arch == 'nvptx64':
|
||||
archs.append('ptx')
|
||||
archs.append('generic')
|
||||
|
||||
subdirs = []
|
||||
for arch in archs:
|
||||
subdirs.append("%s-%s-%s" % (arch, t_vendor, t_os))
|
||||
subdirs.append("%s-%s" % (arch, t_os))
|
||||
subdirs.append(arch)
|
||||
if arch == 'amdgcn':
|
||||
subdirs.append('r600')
|
||||
|
||||
incdirs = filter(os.path.isdir,
|
||||
[os.path.join(srcdir, subdir, 'include') for subdir in subdirs])
|
||||
libdirs = filter(lambda d: os.path.isfile(os.path.join(d, 'SOURCES')),
|
||||
[os.path.join(srcdir, subdir, 'lib') for subdir in subdirs])
|
||||
|
||||
clang_cl_includes = ' '.join(["-I%s" % incdir for incdir in incdirs])
|
||||
|
||||
for device in available_targets[target]['devices']:
|
||||
# The rule for building a .bc file for the specified architecture using clang.
|
||||
clang_bc_flags = "-target %s -I`dirname $in` %s " \
|
||||
"-fno-builtin " \
|
||||
"-Dcl_clang_storage_class_specifiers " \
|
||||
"-Dcl_khr_fp64 " \
|
||||
"-Dcles_khr_int64 " \
|
||||
"-D__CLC_INTERNAL " \
|
||||
"-emit-llvm" % (target, clang_cl_includes)
|
||||
if device['gpu'] != '':
|
||||
clang_bc_flags += ' -mcpu=' + device['gpu']
|
||||
clang_bc_rule = "CLANG_CL_BC_" + target + "_" + device['gpu']
|
||||
c_compiler_rule(b, clang_bc_rule, "LLVM-CC", llvm_clang, clang_bc_flags)
|
||||
|
||||
objects = []
|
||||
sources_seen = set()
|
||||
compats_seen = set()
|
||||
|
||||
if device['gpu'] == '':
|
||||
full_target_name = target
|
||||
obj_suffix = ''
|
||||
else:
|
||||
full_target_name = device['gpu'] + '-' + target
|
||||
obj_suffix = '.' + device['gpu']
|
||||
|
||||
for libdir in libdirs:
|
||||
subdir_list_file = os.path.join(libdir, 'SOURCES')
|
||||
manifest_deps.add(subdir_list_file)
|
||||
override_list_file = os.path.join(libdir, 'OVERRIDES')
|
||||
compat_list_file = os.path.join(libdir,
|
||||
'SOURCES_' + llvm_string_version)
|
||||
|
||||
# Build compat list
|
||||
if os.path.exists(compat_list_file):
|
||||
for compat in open(compat_list_file).readlines():
|
||||
compat = compat.rstrip()
|
||||
compats_seen.add(compat)
|
||||
|
||||
# Add target overrides
|
||||
if os.path.exists(override_list_file):
|
||||
for override in open(override_list_file).readlines():
|
||||
override = override.rstrip()
|
||||
sources_seen.add(override)
|
||||
|
||||
for src in open(subdir_list_file).readlines():
|
||||
src = src.rstrip()
|
||||
if src not in sources_seen:
|
||||
sources_seen.add(src)
|
||||
obj = os.path.join(target, 'lib', src + obj_suffix + '.bc')
|
||||
objects.append(obj)
|
||||
src_path = libdir
|
||||
if src in compats_seen:
|
||||
src_path = os.path.join(libdir, llvm_string_version)
|
||||
src_file = os.path.join(src_path, src)
|
||||
ext = os.path.splitext(src)[1]
|
||||
if ext == '.ll':
|
||||
b.build(obj, 'LLVM_AS', src_file)
|
||||
else:
|
||||
b.build(obj, clang_bc_rule, src_file)
|
||||
|
||||
obj = os.path.join('generic--', 'lib', 'subnormal_use_default.bc')
|
||||
if not options.enable_runtime_subnormal:
|
||||
objects.append(obj)
|
||||
|
||||
builtins_link_bc = os.path.join(target, 'lib', 'builtins.link' + obj_suffix + '.bc')
|
||||
builtins_opt_bc = os.path.join(target, 'lib', 'builtins.opt' + obj_suffix + '.bc')
|
||||
builtins_bc = os.path.join('built_libs', full_target_name + '.bc')
|
||||
b.build(builtins_link_bc, "LLVM_LINK", objects)
|
||||
b.build(builtins_opt_bc, "OPT", builtins_link_bc)
|
||||
b.build(builtins_bc, "PREPARE_BUILTINS", builtins_opt_bc, prepare_builtins)
|
||||
install_files_bc.append((builtins_bc, builtins_bc))
|
||||
install_deps.append(builtins_bc)
|
||||
for alias in device['aliases']:
|
||||
# Ninja cannot have multiple rules with same name so append suffix
|
||||
ruleName = "CREATE_ALIAS_{0}_for_{1}".format(alias, device['gpu'])
|
||||
b.rule(ruleName, "ln -fs %s $out" % os.path.basename(builtins_bc)
|
||||
,"CREATE-ALIAS $out")
|
||||
|
||||
alias_file = os.path.join('built_libs', alias + '-' + target + '.bc')
|
||||
b.build(alias_file, ruleName, builtins_bc)
|
||||
install_files_bc.append((alias_file, alias_file))
|
||||
install_deps.append(alias_file)
|
||||
b.default(builtins_bc)
|
||||
|
||||
|
||||
install_cmd = ' && '.join(['mkdir -p ${DESTDIR}/%(dst)s && cp -r %(src)s ${DESTDIR}/%(dst)s' %
|
||||
{'src': file,
|
||||
'dst': libexecdir}
|
||||
for (file, dest) in install_files_bc])
|
||||
install_cmd = ' && '.join(['%(old)s && mkdir -p ${DESTDIR}/%(dst)s && cp -r %(srcdir)s/generic/include/clc ${DESTDIR}/%(dst)s' %
|
||||
{'old': install_cmd,
|
||||
'dst': includedir,
|
||||
'srcdir': srcdir}])
|
||||
install_cmd = ' && '.join(['%(old)s && mkdir -p ${DESTDIR}/%(dst)s && cp -r libclc.pc ${DESTDIR}/%(dst)s' %
|
||||
{'old': install_cmd,
|
||||
'dst': pkgconfigdir}])
|
||||
|
||||
b.rule('install', command = install_cmd, description = 'INSTALL')
|
||||
b.build('install', 'install', install_deps)
|
||||
|
||||
b.rule("configure", command = ' '.join(sys.argv), description = 'CONFIGURE',
|
||||
generator = True)
|
||||
b.build(b.output_filename(), 'configure', list(manifest_deps))
|
||||
|
||||
b.finish()
|
||||
@@ -1,68 +0,0 @@
|
||||
#define as_char(x) __builtin_astype(x, char)
|
||||
#define as_uchar(x) __builtin_astype(x, uchar)
|
||||
#define as_short(x) __builtin_astype(x, short)
|
||||
#define as_ushort(x) __builtin_astype(x, ushort)
|
||||
#define as_int(x) __builtin_astype(x, int)
|
||||
#define as_uint(x) __builtin_astype(x, uint)
|
||||
#define as_long(x) __builtin_astype(x, long)
|
||||
#define as_ulong(x) __builtin_astype(x, ulong)
|
||||
#define as_float(x) __builtin_astype(x, float)
|
||||
|
||||
#define as_char2(x) __builtin_astype(x, char2)
|
||||
#define as_uchar2(x) __builtin_astype(x, uchar2)
|
||||
#define as_short2(x) __builtin_astype(x, short2)
|
||||
#define as_ushort2(x) __builtin_astype(x, ushort2)
|
||||
#define as_int2(x) __builtin_astype(x, int2)
|
||||
#define as_uint2(x) __builtin_astype(x, uint2)
|
||||
#define as_long2(x) __builtin_astype(x, long2)
|
||||
#define as_ulong2(x) __builtin_astype(x, ulong2)
|
||||
#define as_float2(x) __builtin_astype(x, float2)
|
||||
|
||||
#define as_char3(x) __builtin_astype(x, char3)
|
||||
#define as_uchar3(x) __builtin_astype(x, uchar3)
|
||||
#define as_short3(x) __builtin_astype(x, short3)
|
||||
#define as_ushort3(x) __builtin_astype(x, ushort3)
|
||||
#define as_int3(x) __builtin_astype(x, int3)
|
||||
#define as_uint3(x) __builtin_astype(x, uint3)
|
||||
#define as_long3(x) __builtin_astype(x, long3)
|
||||
#define as_ulong3(x) __builtin_astype(x, ulong3)
|
||||
#define as_float3(x) __builtin_astype(x, float3)
|
||||
|
||||
#define as_char4(x) __builtin_astype(x, char4)
|
||||
#define as_uchar4(x) __builtin_astype(x, uchar4)
|
||||
#define as_short4(x) __builtin_astype(x, short4)
|
||||
#define as_ushort4(x) __builtin_astype(x, ushort4)
|
||||
#define as_int4(x) __builtin_astype(x, int4)
|
||||
#define as_uint4(x) __builtin_astype(x, uint4)
|
||||
#define as_long4(x) __builtin_astype(x, long4)
|
||||
#define as_ulong4(x) __builtin_astype(x, ulong4)
|
||||
#define as_float4(x) __builtin_astype(x, float4)
|
||||
|
||||
#define as_char8(x) __builtin_astype(x, char8)
|
||||
#define as_uchar8(x) __builtin_astype(x, uchar8)
|
||||
#define as_short8(x) __builtin_astype(x, short8)
|
||||
#define as_ushort8(x) __builtin_astype(x, ushort8)
|
||||
#define as_int8(x) __builtin_astype(x, int8)
|
||||
#define as_uint8(x) __builtin_astype(x, uint8)
|
||||
#define as_long8(x) __builtin_astype(x, long8)
|
||||
#define as_ulong8(x) __builtin_astype(x, ulong8)
|
||||
#define as_float8(x) __builtin_astype(x, float8)
|
||||
|
||||
#define as_char16(x) __builtin_astype(x, char16)
|
||||
#define as_uchar16(x) __builtin_astype(x, uchar16)
|
||||
#define as_short16(x) __builtin_astype(x, short16)
|
||||
#define as_ushort16(x) __builtin_astype(x, ushort16)
|
||||
#define as_int16(x) __builtin_astype(x, int16)
|
||||
#define as_uint16(x) __builtin_astype(x, uint16)
|
||||
#define as_long16(x) __builtin_astype(x, long16)
|
||||
#define as_ulong16(x) __builtin_astype(x, ulong16)
|
||||
#define as_float16(x) __builtin_astype(x, float16)
|
||||
|
||||
#ifdef cl_khr_fp64
|
||||
#define as_double(x) __builtin_astype(x, double)
|
||||
#define as_double2(x) __builtin_astype(x, double2)
|
||||
#define as_double3(x) __builtin_astype(x, double3)
|
||||
#define as_double4(x) __builtin_astype(x, double4)
|
||||
#define as_double8(x) __builtin_astype(x, double8)
|
||||
#define as_double16(x) __builtin_astype(x, double16)
|
||||
#endif
|
||||
@@ -1,15 +0,0 @@
|
||||
#define __CLC_DST_ADDR_SPACE local
|
||||
#define __CLC_SRC_ADDR_SPACE global
|
||||
#define __CLC_BODY <clc/async/async_work_group_copy.inc>
|
||||
#include <clc/async/gentype.inc>
|
||||
#undef __CLC_DST_ADDR_SPACE
|
||||
#undef __CLC_SRC_ADDR_SPACE
|
||||
#undef __CLC_BODY
|
||||
|
||||
#define __CLC_DST_ADDR_SPACE global
|
||||
#define __CLC_SRC_ADDR_SPACE local
|
||||
#define __CLC_BODY <clc/async/async_work_group_copy.inc>
|
||||
#include <clc/async/gentype.inc>
|
||||
#undef __CLC_DST_ADDR_SPACE
|
||||
#undef __CLC_SRC_ADDR_SPACE
|
||||
#undef __CLC_BODY
|
||||
@@ -1,5 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL event_t async_work_group_copy(
|
||||
__CLC_DST_ADDR_SPACE __CLC_GENTYPE *dst,
|
||||
const __CLC_SRC_ADDR_SPACE __CLC_GENTYPE *src,
|
||||
size_t num_gentypes,
|
||||
event_t event);
|
||||
@@ -1,15 +0,0 @@
|
||||
#define __CLC_DST_ADDR_SPACE local
|
||||
#define __CLC_SRC_ADDR_SPACE global
|
||||
#define __CLC_BODY <clc/async/async_work_group_strided_copy.inc>
|
||||
#include <clc/async/gentype.inc>
|
||||
#undef __CLC_DST_ADDR_SPACE
|
||||
#undef __CLC_SRC_ADDR_SPACE
|
||||
#undef __CLC_BODY
|
||||
|
||||
#define __CLC_DST_ADDR_SPACE global
|
||||
#define __CLC_SRC_ADDR_SPACE local
|
||||
#define __CLC_BODY <clc/async/async_work_group_strided_copy.inc>
|
||||
#include <clc/async/gentype.inc>
|
||||
#undef __CLC_DST_ADDR_SPACE
|
||||
#undef __CLC_SRC_ADDR_SPACE
|
||||
#undef __CLC_BODY
|
||||
@@ -1,6 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL event_t async_work_group_strided_copy(
|
||||
__CLC_DST_ADDR_SPACE __CLC_GENTYPE *dst,
|
||||
const __CLC_SRC_ADDR_SPACE __CLC_GENTYPE *src,
|
||||
size_t num_gentypes,
|
||||
size_t stride,
|
||||
event_t event);
|
||||
@@ -1,204 +0,0 @@
|
||||
|
||||
#define __CLC_GENTYPE char
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE char2
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE char4
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE char8
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE char16
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE uchar
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE uchar2
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE uchar4
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE uchar8
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE uchar16
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE short
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE short2
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE short4
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE short8
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE short16
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE ushort
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE ushort2
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE ushort4
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE ushort8
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE ushort16
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE int
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE int2
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE int4
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE int8
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE int16
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE uint
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE uint2
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE uint4
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE uint8
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE uint16
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE float
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE float2
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE float4
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE float8
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE float16
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE long
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE long2
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE long4
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE long8
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE long16
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE ulong
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE ulong2
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE ulong4
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE ulong8
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE ulong16
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#ifdef cl_khr_fp64
|
||||
|
||||
#define __CLC_GENTYPE double
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE double2
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE double4
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE double8
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#define __CLC_GENTYPE double16
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_GENTYPE
|
||||
|
||||
#endif
|
||||
@@ -1,3 +0,0 @@
|
||||
#define __CLC_BODY <clc/async/prefetch.inc>
|
||||
#include <clc/async/gentype.inc>
|
||||
#undef __CLC_BODY
|
||||
@@ -1 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL void prefetch(const global __CLC_GENTYPE *p, size_t num_gentypes);
|
||||
@@ -1 +0,0 @@
|
||||
void wait_group_events(int num_events, event_t *event_list);
|
||||
@@ -1,5 +0,0 @@
|
||||
#define __CLC_FUNCTION atomic_add
|
||||
#include <clc/atomic/atomic_decl.inc>
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __CLC_DECLARE_ATOMIC
|
||||
#undef __CLC_DECLARE_ATOMIC_ADDRSPACE
|
||||
@@ -1,5 +0,0 @@
|
||||
#define __CLC_FUNCTION atomic_and
|
||||
#include <clc/atomic/atomic_decl.inc>
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __CLC_DECLARE_ATOMIC
|
||||
#undef __CLC_DECLARE_ATOMIC_ADDRSPACE
|
||||
@@ -1,15 +0,0 @@
|
||||
#define __CLC_FUNCTION atomic_cmpxchg
|
||||
|
||||
#define __CLC_DECLARE_ATOMIC_3_ARG(ADDRSPACE, TYPE) \
|
||||
_CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION (volatile ADDRSPACE TYPE *, TYPE, TYPE);
|
||||
|
||||
#define __CLC_DECLARE_ATOMIC_ADDRSPACE_3_ARG(TYPE) \
|
||||
__CLC_DECLARE_ATOMIC_3_ARG(global, TYPE) \
|
||||
__CLC_DECLARE_ATOMIC_3_ARG(local, TYPE)
|
||||
|
||||
__CLC_DECLARE_ATOMIC_ADDRSPACE_3_ARG(int)
|
||||
__CLC_DECLARE_ATOMIC_ADDRSPACE_3_ARG(uint)
|
||||
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __CLC_DECLARE_ATOMIC_3_ARG
|
||||
#undef __CLC_DECLARE_ATOMIC_ADDRESS_SPACE_3_ARG
|
||||
@@ -1 +0,0 @@
|
||||
#define atomic_dec(p) atomic_sub(p, 1)
|
||||
@@ -1,10 +0,0 @@
|
||||
|
||||
#define __CLC_DECLARE_ATOMIC(ADDRSPACE, TYPE) \
|
||||
_CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION (volatile ADDRSPACE TYPE *, TYPE);
|
||||
|
||||
#define __CLC_DECLARE_ATOMIC_ADDRSPACE(TYPE) \
|
||||
__CLC_DECLARE_ATOMIC(global, TYPE) \
|
||||
__CLC_DECLARE_ATOMIC(local, TYPE)
|
||||
|
||||
__CLC_DECLARE_ATOMIC_ADDRSPACE(int)
|
||||
__CLC_DECLARE_ATOMIC_ADDRSPACE(uint)
|
||||
@@ -1 +0,0 @@
|
||||
#define atomic_inc(p) atomic_add(p, 1)
|
||||
@@ -1,5 +0,0 @@
|
||||
#define __CLC_FUNCTION atomic_max
|
||||
#include <clc/atomic/atomic_decl.inc>
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __CLC_DECLARE_ATOMIC
|
||||
#undef __CLC_DECLARE_ATOMIC_ADDRSPACE
|
||||
@@ -1,5 +0,0 @@
|
||||
#define __CLC_FUNCTION atomic_min
|
||||
#include <clc/atomic/atomic_decl.inc>
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __CLC_DECLARE_ATOMIC
|
||||
#undef __CLC_DECLARE_ATOMIC_ADDRSPACE
|
||||
@@ -1,5 +0,0 @@
|
||||
#define __CLC_FUNCTION atomic_or
|
||||
#include <clc/atomic/atomic_decl.inc>
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __CLC_DECLARE_ATOMIC
|
||||
#undef __CLC_DECLARE_ATOMIC_ADDRSPACE
|
||||
@@ -1,5 +0,0 @@
|
||||
#define __CLC_FUNCTION atomic_sub
|
||||
#include <clc/atomic/atomic_decl.inc>
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __CLC_DECLARE_ATOMIC
|
||||
#undef __CLC_DECLARE_ATOMIC_ADDRSPACE
|
||||
@@ -1,6 +0,0 @@
|
||||
#define __CLC_FUNCTION atomic_xchg
|
||||
#include <clc/atomic/atomic_decl.inc>
|
||||
__CLC_DECLARE_ATOMIC_ADDRSPACE(float);
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __CLC_DECLARE_ATOMIC
|
||||
#undef __CLC_DECLARE_ATOMIC_ADDRSPACE
|
||||
@@ -1,5 +0,0 @@
|
||||
#define __CLC_FUNCTION atomic_xor
|
||||
#include <clc/atomic/atomic_decl.inc>
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __CLC_DECLARE_ATOMIC
|
||||
#undef __CLC_DECLARE_ATOMIC_ADDRSPACE
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_add(global int *p, int val);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_add(global unsigned int *p, unsigned int val);
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_cmpxchg(global int *p, int cmp, int val);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_cmpxchg(global unsigned int *p, unsigned int cmp, unsigned int val);
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_dec(global int *p);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_dec(global unsigned int *p);
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_inc(global int *p);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_inc(global unsigned int *p);
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_sub(global int *p, int val);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_sub(global unsigned int *p, unsigned int val);
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_xchg(global int *p, int val);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_xchg(global unsigned int *p, unsigned int val);
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_and(global int *p, int val);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_and(global unsigned int *p, unsigned int val);
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_max(global int *p, int val);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_max(global unsigned int *p, unsigned int val);
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_min(global int *p, int val);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_min(global unsigned int *p, unsigned int val);
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_or(global int *p, int val);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_or(global unsigned int *p, unsigned int val);
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_xor(global int *p, int val);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_xor(global unsigned int *p, unsigned int val);
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_add(local int *p, int val);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_add(local unsigned int *p, unsigned int val);
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_cmpxchg(local int *p, int cmp, int val);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_cmpxchg(local unsigned int *p, unsigned int cmp, unsigned int val);
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_dec(local int *p);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_dec(local unsigned int *p);
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_inc(local int *p);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_inc(local unsigned int *p);
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_sub(local int *p, int val);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_sub(local unsigned int *p, unsigned int val);
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_xchg(local int *p, int val);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_xchg(local unsigned int *p, unsigned int val);
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_and(local int *p, int val);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_and(local unsigned int *p, unsigned int val);
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_max(local int *p, int val);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_max(local unsigned int *p, unsigned int val);
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_min(local int *p, int val);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_min(local unsigned int *p, unsigned int val);
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_or(local int *p, int val);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_or(local unsigned int *p, unsigned int val);
|
||||
@@ -1,2 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL int atom_xor(local int *p, int val);
|
||||
_CLC_OVERLOAD _CLC_DECL unsigned int atom_xor(local unsigned int *p, unsigned int val);
|
||||
@@ -1,218 +0,0 @@
|
||||
#ifndef cl_clang_storage_class_specifiers
|
||||
#error Implementation requires cl_clang_storage_class_specifiers extension!
|
||||
#endif
|
||||
|
||||
#pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable
|
||||
|
||||
#ifdef cl_khr_fp64
|
||||
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
|
||||
#endif
|
||||
|
||||
/* Function Attributes */
|
||||
#include <clc/clcfunc.h>
|
||||
|
||||
/* 6.1 Supported Data Types */
|
||||
#include <clc/clctypes.h>
|
||||
|
||||
/* 6.2.3 Explicit Conversions */
|
||||
#include <clc/convert.h>
|
||||
|
||||
/* 6.2.4.2 Reinterpreting Types Using as_type() and as_typen() */
|
||||
#include <clc/as_type.h>
|
||||
|
||||
/* 6.9 Preprocessor Directives and Macros */
|
||||
#include <clc/clcversion.h>
|
||||
|
||||
/* 6.11.1 Work-Item Functions */
|
||||
#include <clc/workitem/get_global_size.h>
|
||||
#include <clc/workitem/get_global_id.h>
|
||||
#include <clc/workitem/get_local_size.h>
|
||||
#include <clc/workitem/get_local_id.h>
|
||||
#include <clc/workitem/get_num_groups.h>
|
||||
#include <clc/workitem/get_group_id.h>
|
||||
|
||||
/* 6.11.2 Math Functions */
|
||||
#include <clc/math/acos.h>
|
||||
#include <clc/math/acosh.h>
|
||||
#include <clc/math/acospi.h>
|
||||
#include <clc/math/asin.h>
|
||||
#include <clc/math/asinh.h>
|
||||
#include <clc/math/asinpi.h>
|
||||
#include <clc/math/atan.h>
|
||||
#include <clc/math/atan2.h>
|
||||
#include <clc/math/atan2pi.h>
|
||||
#include <clc/math/atanh.h>
|
||||
#include <clc/math/atanpi.h>
|
||||
#include <clc/math/copysign.h>
|
||||
#include <clc/math/cos.h>
|
||||
#include <clc/math/cospi.h>
|
||||
#include <clc/math/ceil.h>
|
||||
#include <clc/math/erfc.h>
|
||||
#include <clc/math/exp.h>
|
||||
#include <clc/math/exp10.h>
|
||||
#include <clc/math/exp2.h>
|
||||
#include <clc/math/fabs.h>
|
||||
#include <clc/math/floor.h>
|
||||
#include <clc/math/fma.h>
|
||||
#include <clc/math/fmax.h>
|
||||
#include <clc/math/fmin.h>
|
||||
#include <clc/math/fmod.h>
|
||||
#include <clc/math/fract.h>
|
||||
#include <clc/math/half_rsqrt.h>
|
||||
#include <clc/math/half_sqrt.h>
|
||||
#include <clc/math/hypot.h>
|
||||
#include <clc/math/ldexp.h>
|
||||
#include <clc/math/log.h>
|
||||
#include <clc/math/log10.h>
|
||||
#include <clc/math/log1p.h>
|
||||
#include <clc/math/log2.h>
|
||||
#include <clc/math/mad.h>
|
||||
#include <clc/math/nextafter.h>
|
||||
#include <clc/math/pow.h>
|
||||
#include <clc/math/pown.h>
|
||||
#include <clc/math/rint.h>
|
||||
#include <clc/math/round.h>
|
||||
#include <clc/math/sin.h>
|
||||
#include <clc/math/sincos.h>
|
||||
#include <clc/math/sinpi.h>
|
||||
#include <clc/math/sqrt.h>
|
||||
#include <clc/math/tan.h>
|
||||
#include <clc/math/trunc.h>
|
||||
#include <clc/math/native_cos.h>
|
||||
#include <clc/math/native_divide.h>
|
||||
#include <clc/math/native_exp.h>
|
||||
#include <clc/math/native_exp10.h>
|
||||
#include <clc/math/native_exp2.h>
|
||||
#include <clc/math/native_log.h>
|
||||
#include <clc/math/native_log2.h>
|
||||
#include <clc/math/native_powr.h>
|
||||
#include <clc/math/native_sin.h>
|
||||
#include <clc/math/native_sqrt.h>
|
||||
#include <clc/math/rsqrt.h>
|
||||
|
||||
/* 6.11.2.1 Floating-point macros */
|
||||
#include <clc/float/definitions.h>
|
||||
|
||||
/* 6.11.3 Integer Functions */
|
||||
#include <clc/integer/abs.h>
|
||||
#include <clc/integer/abs_diff.h>
|
||||
#include <clc/integer/add_sat.h>
|
||||
#include <clc/integer/clz.h>
|
||||
#include <clc/integer/hadd.h>
|
||||
#include <clc/integer/mad24.h>
|
||||
#include <clc/integer/mad_hi.h>
|
||||
#include <clc/integer/mad_sat.h>
|
||||
#include <clc/integer/mul24.h>
|
||||
#include <clc/integer/mul_hi.h>
|
||||
#include <clc/integer/rhadd.h>
|
||||
#include <clc/integer/rotate.h>
|
||||
#include <clc/integer/sub_sat.h>
|
||||
#include <clc/integer/upsample.h>
|
||||
|
||||
/* 6.11.3 Integer Definitions */
|
||||
#include <clc/integer/definitions.h>
|
||||
|
||||
/* 6.11.2 and 6.11.3 Shared Integer/Math Functions */
|
||||
#include <clc/shared/clamp.h>
|
||||
#include <clc/shared/max.h>
|
||||
#include <clc/shared/min.h>
|
||||
#include <clc/shared/vload.h>
|
||||
#include <clc/shared/vstore.h>
|
||||
|
||||
/* 6.11.4 Common Functions */
|
||||
#include <clc/common/degrees.h>
|
||||
#include <clc/common/radians.h>
|
||||
#include <clc/common/mix.h>
|
||||
#include <clc/common/sign.h>
|
||||
#include <clc/common/smoothstep.h>
|
||||
#include <clc/common/step.h>
|
||||
|
||||
/* 6.11.5 Geometric Functions */
|
||||
#include <clc/geometric/cross.h>
|
||||
#include <clc/geometric/distance.h>
|
||||
#include <clc/geometric/dot.h>
|
||||
#include <clc/geometric/fast_distance.h>
|
||||
#include <clc/geometric/fast_length.h>
|
||||
#include <clc/geometric/fast_normalize.h>
|
||||
#include <clc/geometric/length.h>
|
||||
#include <clc/geometric/normalize.h>
|
||||
|
||||
/* 6.11.6 Relational Functions */
|
||||
#include <clc/relational/all.h>
|
||||
#include <clc/relational/any.h>
|
||||
#include <clc/relational/bitselect.h>
|
||||
#include <clc/relational/isequal.h>
|
||||
#include <clc/relational/isfinite.h>
|
||||
#include <clc/relational/isgreater.h>
|
||||
#include <clc/relational/isgreaterequal.h>
|
||||
#include <clc/relational/isinf.h>
|
||||
#include <clc/relational/isless.h>
|
||||
#include <clc/relational/islessequal.h>
|
||||
#include <clc/relational/islessgreater.h>
|
||||
#include <clc/relational/isnan.h>
|
||||
#include <clc/relational/isnormal.h>
|
||||
#include <clc/relational/isnotequal.h>
|
||||
#include <clc/relational/isordered.h>
|
||||
#include <clc/relational/isunordered.h>
|
||||
#include <clc/relational/select.h>
|
||||
#include <clc/relational/signbit.h>
|
||||
|
||||
/* 6.11.8 Synchronization Functions */
|
||||
#include <clc/synchronization/cl_mem_fence_flags.h>
|
||||
#include <clc/synchronization/barrier.h>
|
||||
|
||||
/* 6.11.10 Async Copy and Prefetch Functions */
|
||||
#include <clc/async/async_work_group_copy.h>
|
||||
#include <clc/async/async_work_group_strided_copy.h>
|
||||
#include <clc/async/prefetch.h>
|
||||
#include <clc/async/wait_group_events.h>
|
||||
|
||||
/* 6.11.11 Atomic Functions */
|
||||
#include <clc/atomic/atomic_add.h>
|
||||
#include <clc/atomic/atomic_and.h>
|
||||
#include <clc/atomic/atomic_cmpxchg.h>
|
||||
#include <clc/atomic/atomic_dec.h>
|
||||
#include <clc/atomic/atomic_inc.h>
|
||||
#include <clc/atomic/atomic_max.h>
|
||||
#include <clc/atomic/atomic_min.h>
|
||||
#include <clc/atomic/atomic_or.h>
|
||||
#include <clc/atomic/atomic_sub.h>
|
||||
#include <clc/atomic/atomic_xchg.h>
|
||||
#include <clc/atomic/atomic_xor.h>
|
||||
|
||||
/* cl_khr_global_int32_base_atomics Extension Functions */
|
||||
#include <clc/cl_khr_global_int32_base_atomics/atom_add.h>
|
||||
#include <clc/cl_khr_global_int32_base_atomics/atom_cmpxchg.h>
|
||||
#include <clc/cl_khr_global_int32_base_atomics/atom_dec.h>
|
||||
#include <clc/cl_khr_global_int32_base_atomics/atom_inc.h>
|
||||
#include <clc/cl_khr_global_int32_base_atomics/atom_sub.h>
|
||||
#include <clc/cl_khr_global_int32_base_atomics/atom_xchg.h>
|
||||
|
||||
/* cl_khr_global_int32_extended_atomics Extension Functions */
|
||||
#include <clc/cl_khr_global_int32_extended_atomics/atom_and.h>
|
||||
#include <clc/cl_khr_global_int32_extended_atomics/atom_max.h>
|
||||
#include <clc/cl_khr_global_int32_extended_atomics/atom_min.h>
|
||||
#include <clc/cl_khr_global_int32_extended_atomics/atom_or.h>
|
||||
#include <clc/cl_khr_global_int32_extended_atomics/atom_xor.h>
|
||||
|
||||
/* cl_khr_local_int32_base_atomics Extension Functions */
|
||||
#include <clc/cl_khr_local_int32_base_atomics/atom_add.h>
|
||||
#include <clc/cl_khr_local_int32_base_atomics/atom_cmpxchg.h>
|
||||
#include <clc/cl_khr_local_int32_base_atomics/atom_dec.h>
|
||||
#include <clc/cl_khr_local_int32_base_atomics/atom_inc.h>
|
||||
#include <clc/cl_khr_local_int32_base_atomics/atom_sub.h>
|
||||
#include <clc/cl_khr_local_int32_base_atomics/atom_xchg.h>
|
||||
|
||||
/* cl_khr_local_int32_extended_atomics Extension Functions */
|
||||
#include <clc/cl_khr_local_int32_extended_atomics/atom_and.h>
|
||||
#include <clc/cl_khr_local_int32_extended_atomics/atom_max.h>
|
||||
#include <clc/cl_khr_local_int32_extended_atomics/atom_min.h>
|
||||
#include <clc/cl_khr_local_int32_extended_atomics/atom_or.h>
|
||||
#include <clc/cl_khr_local_int32_extended_atomics/atom_xor.h>
|
||||
|
||||
/* libclc internal defintions */
|
||||
#ifdef __CLC_INTERNAL
|
||||
#include <math/clc_nextafter.h>
|
||||
#endif
|
||||
|
||||
#pragma OPENCL EXTENSION all : disable
|
||||
@@ -1,4 +0,0 @@
|
||||
#define _CLC_OVERLOAD __attribute__((overloadable))
|
||||
#define _CLC_DECL
|
||||
#define _CLC_DEF __attribute__((always_inline))
|
||||
#define _CLC_INLINE __attribute__((always_inline)) inline
|
||||
@@ -1,89 +0,0 @@
|
||||
/* 6.1.1 Built-in Scalar Data Types */
|
||||
|
||||
typedef unsigned char uchar;
|
||||
typedef unsigned short ushort;
|
||||
typedef unsigned int uint;
|
||||
typedef unsigned long ulong;
|
||||
|
||||
typedef __SIZE_TYPE__ size_t;
|
||||
typedef __PTRDIFF_TYPE__ ptrdiff_t;
|
||||
|
||||
#define __stdint_join3(a,b,c) a ## b ## c
|
||||
|
||||
#define __intn_t(n) __stdint_join3(__INT, n, _TYPE__)
|
||||
#define __uintn_t(n) __stdint_join3(unsigned __INT, n, _TYPE__)
|
||||
|
||||
typedef __intn_t(__INTPTR_WIDTH__) intptr_t;
|
||||
typedef __uintn_t(__INTPTR_WIDTH__) uintptr_t;
|
||||
|
||||
#undef __uintn_t
|
||||
#undef __intn_t
|
||||
#undef __stdint_join3
|
||||
|
||||
/* 6.1.2 Built-in Vector Data Types */
|
||||
|
||||
typedef __attribute__((ext_vector_type(2))) char char2;
|
||||
typedef __attribute__((ext_vector_type(3))) char char3;
|
||||
typedef __attribute__((ext_vector_type(4))) char char4;
|
||||
typedef __attribute__((ext_vector_type(8))) char char8;
|
||||
typedef __attribute__((ext_vector_type(16))) char char16;
|
||||
|
||||
typedef __attribute__((ext_vector_type(2))) uchar uchar2;
|
||||
typedef __attribute__((ext_vector_type(3))) uchar uchar3;
|
||||
typedef __attribute__((ext_vector_type(4))) uchar uchar4;
|
||||
typedef __attribute__((ext_vector_type(8))) uchar uchar8;
|
||||
typedef __attribute__((ext_vector_type(16))) uchar uchar16;
|
||||
|
||||
typedef __attribute__((ext_vector_type(2))) short short2;
|
||||
typedef __attribute__((ext_vector_type(3))) short short3;
|
||||
typedef __attribute__((ext_vector_type(4))) short short4;
|
||||
typedef __attribute__((ext_vector_type(8))) short short8;
|
||||
typedef __attribute__((ext_vector_type(16))) short short16;
|
||||
|
||||
typedef __attribute__((ext_vector_type(2))) ushort ushort2;
|
||||
typedef __attribute__((ext_vector_type(3))) ushort ushort3;
|
||||
typedef __attribute__((ext_vector_type(4))) ushort ushort4;
|
||||
typedef __attribute__((ext_vector_type(8))) ushort ushort8;
|
||||
typedef __attribute__((ext_vector_type(16))) ushort ushort16;
|
||||
|
||||
typedef __attribute__((ext_vector_type(2))) int int2;
|
||||
typedef __attribute__((ext_vector_type(3))) int int3;
|
||||
typedef __attribute__((ext_vector_type(4))) int int4;
|
||||
typedef __attribute__((ext_vector_type(8))) int int8;
|
||||
typedef __attribute__((ext_vector_type(16))) int int16;
|
||||
|
||||
typedef __attribute__((ext_vector_type(2))) uint uint2;
|
||||
typedef __attribute__((ext_vector_type(3))) uint uint3;
|
||||
typedef __attribute__((ext_vector_type(4))) uint uint4;
|
||||
typedef __attribute__((ext_vector_type(8))) uint uint8;
|
||||
typedef __attribute__((ext_vector_type(16))) uint uint16;
|
||||
|
||||
typedef __attribute__((ext_vector_type(2))) long long2;
|
||||
typedef __attribute__((ext_vector_type(3))) long long3;
|
||||
typedef __attribute__((ext_vector_type(4))) long long4;
|
||||
typedef __attribute__((ext_vector_type(8))) long long8;
|
||||
typedef __attribute__((ext_vector_type(16))) long long16;
|
||||
|
||||
typedef __attribute__((ext_vector_type(2))) ulong ulong2;
|
||||
typedef __attribute__((ext_vector_type(3))) ulong ulong3;
|
||||
typedef __attribute__((ext_vector_type(4))) ulong ulong4;
|
||||
typedef __attribute__((ext_vector_type(8))) ulong ulong8;
|
||||
typedef __attribute__((ext_vector_type(16))) ulong ulong16;
|
||||
|
||||
typedef __attribute__((ext_vector_type(2))) float float2;
|
||||
typedef __attribute__((ext_vector_type(3))) float float3;
|
||||
typedef __attribute__((ext_vector_type(4))) float float4;
|
||||
typedef __attribute__((ext_vector_type(8))) float float8;
|
||||
typedef __attribute__((ext_vector_type(16))) float float16;
|
||||
|
||||
/* 9.3 Double Precision Floating-Point */
|
||||
|
||||
#ifdef cl_khr_fp64
|
||||
typedef __attribute__((ext_vector_type(2))) double double2;
|
||||
typedef __attribute__((ext_vector_type(3))) double double3;
|
||||
typedef __attribute__((ext_vector_type(4))) double double4;
|
||||
typedef __attribute__((ext_vector_type(8))) double double8;
|
||||
typedef __attribute__((ext_vector_type(16))) double double16;
|
||||
#endif
|
||||
|
||||
#define NULL ((void *)0)
|
||||
@@ -1,8 +0,0 @@
|
||||
#if __OPENCL_VERSION__ >= 110
|
||||
#define CLC_VERSION_1_0 100
|
||||
#define CLC_VERSION_1_1 110
|
||||
#endif
|
||||
|
||||
#if __OPENCL_VERSION__ >= 120
|
||||
#define CLC_VERSION_1_2 120
|
||||
#endif
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014,2015 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define __CLC_BODY <clc/common/degrees.inc>
|
||||
#include <clc/math/gentype.inc>
|
||||
#undef __CLC_BODY
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014,2015 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE degrees(__CLC_GENTYPE x);
|
||||
@@ -1,2 +0,0 @@
|
||||
#define __CLC_BODY <clc/common/mix.inc>
|
||||
#include <clc/math/gentype.inc>
|
||||
@@ -1,5 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mix(__CLC_GENTYPE a, __CLC_GENTYPE b, __CLC_GENTYPE c);
|
||||
|
||||
#ifndef __CLC_SCALAR
|
||||
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mix(__CLC_GENTYPE a, __CLC_GENTYPE b, __CLC_SCALAR_GENTYPE c);
|
||||
#endif
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014,2015 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define __CLC_BODY <clc/common/radians.inc>
|
||||
#include <clc/math/gentype.inc>
|
||||
#undef __CLC_BODY
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014,2015 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE radians(__CLC_GENTYPE x);
|
||||
@@ -1,5 +0,0 @@
|
||||
#define __CLC_FUNCTION sign
|
||||
#define __CLC_BODY <clc/math/unary_decl.inc>
|
||||
#include <clc/math/gentype.inc>
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __CLC_BODY
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014,2015 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define __CLC_BODY <clc/common/smoothstep.inc>
|
||||
#include <clc/math/gentype.inc>
|
||||
#undef __CLC_BODY
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014,2015 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE smoothstep(__CLC_GENTYPE edge0, __CLC_GENTYPE edge1, __CLC_GENTYPE x);
|
||||
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE smoothstep(float edge0, float edge1, __CLC_GENTYPE x);
|
||||
|
||||
#ifdef cl_khr_fp64
|
||||
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE smoothstep(double edge0, double edge1, __CLC_GENTYPE x);
|
||||
#endif
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014,2015 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define __CLC_BODY <clc/common/step.inc>
|
||||
#include <clc/math/gentype.inc>
|
||||
#undef __CLC_BODY
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014,2015 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE step(__CLC_GENTYPE edge, __CLC_GENTYPE x);
|
||||
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE step(float edge, __CLC_GENTYPE x);
|
||||
|
||||
#ifdef cl_khr_fp64
|
||||
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE step(double edge, __CLC_GENTYPE x);
|
||||
#endif
|
||||
@@ -1,60 +0,0 @@
|
||||
#define _CLC_CONVERT_DECL(FROM_TYPE, TO_TYPE, SUFFIX) \
|
||||
_CLC_OVERLOAD _CLC_DECL TO_TYPE convert_##TO_TYPE##SUFFIX(FROM_TYPE x);
|
||||
|
||||
#define _CLC_VECTOR_CONVERT_DECL(FROM_TYPE, TO_TYPE, SUFFIX) \
|
||||
_CLC_CONVERT_DECL(FROM_TYPE, TO_TYPE, SUFFIX) \
|
||||
_CLC_CONVERT_DECL(FROM_TYPE##2, TO_TYPE##2, SUFFIX) \
|
||||
_CLC_CONVERT_DECL(FROM_TYPE##3, TO_TYPE##3, SUFFIX) \
|
||||
_CLC_CONVERT_DECL(FROM_TYPE##4, TO_TYPE##4, SUFFIX) \
|
||||
_CLC_CONVERT_DECL(FROM_TYPE##8, TO_TYPE##8, SUFFIX) \
|
||||
_CLC_CONVERT_DECL(FROM_TYPE##16, TO_TYPE##16, SUFFIX)
|
||||
|
||||
#define _CLC_VECTOR_CONVERT_FROM1(FROM_TYPE, SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, char, SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, uchar, SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, int, SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, uint, SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, short, SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, ushort, SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, long, SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, ulong, SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, float, SUFFIX)
|
||||
|
||||
#ifdef cl_khr_fp64
|
||||
#define _CLC_VECTOR_CONVERT_FROM(FROM_TYPE, SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_FROM1(FROM_TYPE, SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, double, SUFFIX)
|
||||
#else
|
||||
#define _CLC_VECTOR_CONVERT_FROM(FROM_TYPE, SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_FROM1(FROM_TYPE, SUFFIX)
|
||||
#endif
|
||||
|
||||
#define _CLC_VECTOR_CONVERT_TO1(SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_FROM(char, SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_FROM(uchar, SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_FROM(int, SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_FROM(uint, SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_FROM(short, SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_FROM(ushort, SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_FROM(long, SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_FROM(ulong, SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_FROM(float, SUFFIX)
|
||||
|
||||
#ifdef cl_khr_fp64
|
||||
#define _CLC_VECTOR_CONVERT_TO(SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_TO1(SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_FROM(double, SUFFIX)
|
||||
#else
|
||||
#define _CLC_VECTOR_CONVERT_TO(SUFFIX) \
|
||||
_CLC_VECTOR_CONVERT_TO1(SUFFIX)
|
||||
#endif
|
||||
|
||||
#define _CLC_VECTOR_CONVERT_TO_SUFFIX(ROUND) \
|
||||
_CLC_VECTOR_CONVERT_TO(_sat##ROUND) \
|
||||
_CLC_VECTOR_CONVERT_TO(ROUND)
|
||||
|
||||
_CLC_VECTOR_CONVERT_TO_SUFFIX(_rtn)
|
||||
_CLC_VECTOR_CONVERT_TO_SUFFIX(_rte)
|
||||
_CLC_VECTOR_CONVERT_TO_SUFFIX(_rtz)
|
||||
_CLC_VECTOR_CONVERT_TO_SUFFIX(_rtp)
|
||||
_CLC_VECTOR_CONVERT_TO_SUFFIX()
|
||||
@@ -1,74 +0,0 @@
|
||||
#define MAXFLOAT 0x1.fffffep127f
|
||||
#define HUGE_VALF __builtin_huge_valf()
|
||||
#define INFINITY __builtin_inff()
|
||||
#define NAN __builtin_nanf("")
|
||||
|
||||
#define FLT_DIG 6
|
||||
#define FLT_MANT_DIG 24
|
||||
#define FLT_MAX_10_EXP +38
|
||||
#define FLT_MAX_EXP +128
|
||||
#define FLT_MIN_10_EXP -37
|
||||
#define FLT_MIN_EXP -125
|
||||
#define FLT_RADIX 2
|
||||
#define FLT_MAX MAXFLOAT
|
||||
#define FLT_MIN 0x1.0p-126f
|
||||
#define FLT_EPSILON 0x1.0p-23f
|
||||
|
||||
#define M_E_F 0x1.5bf0a8p+1f
|
||||
#define M_LOG2E_F 0x1.715476p+0f
|
||||
#define M_LOG10E_F 0x1.bcb7b2p-2f
|
||||
#define M_LN2_F 0x1.62e430p-1f
|
||||
#define M_LN10_F 0x1.26bb1cp+1f
|
||||
#define M_PI_F 0x1.921fb6p+1f
|
||||
#define M_PI_2_F 0x1.921fb6p+0f
|
||||
#define M_PI_4_F 0x1.921fb6p-1f
|
||||
#define M_1_PI_F 0x1.45f306p-2f
|
||||
#define M_2_PI_F 0x1.45f306p-1f
|
||||
#define M_2_SQRTPI_F 0x1.20dd76p+0f
|
||||
#define M_SQRT2_F 0x1.6a09e6p+0f
|
||||
#define M_SQRT1_2_F 0x1.6a09e6p-1f
|
||||
|
||||
#ifdef cl_khr_fp64
|
||||
|
||||
#define HUGE_VAL __builtin_huge_val()
|
||||
|
||||
#define DBL_DIG 15
|
||||
#define DBL_MANT_DIG 53
|
||||
#define DBL_MAX_10_EXP +308
|
||||
#define DBL_MAX_EXP +1024
|
||||
#define DBL_MIN_10_EXP -307
|
||||
#define DBL_MIN_EXP -1021
|
||||
#define DBL_MAX 0x1.fffffffffffffp1023
|
||||
#define DBL_MIN 0x1.0p-1022
|
||||
#define DBL_EPSILON 0x1.0p-52
|
||||
|
||||
#define M_E 0x1.5bf0a8b145769p+1
|
||||
#define M_LOG2E 0x1.71547652b82fep+0
|
||||
#define M_LOG10E 0x1.bcb7b1526e50ep-2
|
||||
#define M_LN2 0x1.62e42fefa39efp-1
|
||||
#define M_LN10 0x1.26bb1bbb55516p+1
|
||||
#define M_PI 0x1.921fb54442d18p+1
|
||||
#define M_PI_2 0x1.921fb54442d18p+0
|
||||
#define M_PI_4 0x1.921fb54442d18p-1
|
||||
#define M_1_PI 0x1.45f306dc9c883p-2
|
||||
#define M_2_PI 0x1.45f306dc9c883p-1
|
||||
#define M_2_SQRTPI 0x1.20dd750429b6dp+0
|
||||
#define M_SQRT2 0x1.6a09e667f3bcdp+0
|
||||
#define M_SQRT1_2 0x1.6a09e667f3bcdp-1
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef cl_khr_fp16
|
||||
|
||||
#if __OPENCL_VERSION__ >= 120
|
||||
|
||||
#define HALF_DIG 3
|
||||
#define HALF_MANT_DIG 11
|
||||
#define HALF_MAX_10_EXP +4
|
||||
#define HALF_MAX_EXP +16
|
||||
#define HALF_MIN_10_EXP -4
|
||||
#define HALF_MIN_EXP -13
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,7 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL float3 cross(float3 p0, float3 p1);
|
||||
_CLC_OVERLOAD _CLC_DECL float4 cross(float4 p0, float4 p1);
|
||||
|
||||
#ifdef cl_khr_fp64
|
||||
_CLC_OVERLOAD _CLC_DECL double3 cross(double3 p0, double3 p1);
|
||||
_CLC_OVERLOAD _CLC_DECL double4 cross(double4 p0, double4 p1);
|
||||
#endif
|
||||
@@ -1,2 +0,0 @@
|
||||
#define __CLC_BODY <clc/geometric/distance.inc>
|
||||
#include <clc/geometric/floatn.inc>
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014,2015 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
_CLC_OVERLOAD _CLC_DECL __CLC_FLOAT distance(__CLC_FLOATN p0, __CLC_FLOATN p1);
|
||||
@@ -1,2 +0,0 @@
|
||||
#define __CLC_BODY <clc/geometric/dot.inc>
|
||||
#include <clc/geometric/floatn.inc>
|
||||
@@ -1 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL __CLC_FLOAT dot(__CLC_FLOATN p0, __CLC_FLOATN p1);
|
||||
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014,2015 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define __CLC_BODY <clc/geometric/fast_distance.inc>
|
||||
#define __FLOAT_ONLY
|
||||
#include <clc/geometric/floatn.inc>
|
||||
#undef __FLOAT_ONLY
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014,2015 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
_CLC_OVERLOAD _CLC_DECL __CLC_FLOAT fast_distance(__CLC_FLOATN p0, __CLC_FLOATN p1);
|
||||
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014,2015 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define __CLC_BODY <clc/geometric/fast_length.inc>
|
||||
#define __FLOAT_ONLY
|
||||
#include <clc/geometric/floatn.inc>
|
||||
#undef __FLOAT_ONLY
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014,2015 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
_CLC_OVERLOAD _CLC_DECL __CLC_FLOAT fast_length(__CLC_FLOATN p0);
|
||||
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014,2015 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define __CLC_BODY <clc/geometric/fast_normalize.inc>
|
||||
#define __FLOAT_ONLY
|
||||
#include <clc/geometric/floatn.inc>
|
||||
#undef __FLOAT_ONLY
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014,2015 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
_CLC_OVERLOAD _CLC_DECL __CLC_FLOATN fast_normalize(__CLC_FLOATN p);
|
||||
@@ -1,55 +0,0 @@
|
||||
#define __CLC_FLOAT float
|
||||
#define __CLC_FPSIZE 32
|
||||
|
||||
#define __CLC_FLOATN float
|
||||
#define __CLC_SCALAR
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_FLOATN
|
||||
#undef __CLC_SCALAR
|
||||
|
||||
#define __CLC_FLOATN float2
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_FLOATN
|
||||
|
||||
#define __CLC_FLOATN float3
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_FLOATN
|
||||
|
||||
#define __CLC_FLOATN float4
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_FLOATN
|
||||
|
||||
#undef __CLC_FLOAT
|
||||
#undef __CLC_FPSIZE
|
||||
|
||||
#ifndef __FLOAT_ONLY
|
||||
#ifdef cl_khr_fp64
|
||||
|
||||
#define __CLC_FLOAT double
|
||||
#define __CLC_FPSIZE 64
|
||||
|
||||
#define __CLC_FLOATN double
|
||||
#define __CLC_SCALAR
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_FLOATN
|
||||
#undef __CLC_SCALAR
|
||||
|
||||
#define __CLC_FLOATN double2
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_FLOATN
|
||||
|
||||
#define __CLC_FLOATN double3
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_FLOATN
|
||||
|
||||
#define __CLC_FLOATN double4
|
||||
#include __CLC_BODY
|
||||
#undef __CLC_FLOATN
|
||||
|
||||
#undef __CLC_FLOAT
|
||||
#undef __CLC_FPSIZE
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#undef __CLC_BODY
|
||||
@@ -1,2 +0,0 @@
|
||||
#define __CLC_BODY <clc/geometric/length.inc>
|
||||
#include <clc/geometric/floatn.inc>
|
||||
@@ -1 +0,0 @@
|
||||
_CLC_OVERLOAD _CLC_DECL __CLC_FLOAT length(__CLC_FLOATN p0);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user