Alea GPU Compiler directives like "__unroll"? - aleagpu

Just discovered Alea.Gpu and am very pleased with its simplicity of use and C# integration.
However I was just wondering if compiler directives such as "__unroll" are available somewhere? It seems that it used to be available in the Alea.CUDA package which seems deprecated.
Any tips ?
Regards

this directive works only for F# quotation based code. It provides kernel as a F# quotation. C# coded kernel is not supported.
For more information on using AleaGPU in F#, see http://www.aleagpu.com/release/3_0_3/doc/advanced_features_fsharp.html

Related

GXMVECTOR - Documentation?

I am trying to re-learn directx after a decade of doing other things. I read a tutorial on the github wiki on how to render some sprites:
https://github.com/Microsoft/DirectXTK/wiki/Sprites-and-textures
In the Draw method it uses 'DirectX::SpriteBatch::Draw' and one of the overloads seems to have a parameters for an 'FXMVECTOR' and 'GXMVECTOR'. I managed to find some documentation for the former, but can't find any for the latter.
Can anyone tell me where to look?
Is it part of DirectXMath or something else?
When you see FXMVECTOR, CXMVECTOR, GXMVECTOR, or HXMVECTOR just read XMVECTOR. Same for FXMMATRIX and CXMMATRIX vs. XMMATRIX. It's just some typedef magic stuff I had to do to support the various calling conventions for x86 __fastcall, x64 __fastcall, x86/x64 __vectorcall, and Windows on ARM which are all subtlety different.
For documentation details on these types, see Microsoft Docs.
If you are new to DirectXMath, you probably want to take a look at the Simple Math wrapper in the DirectX Tool Kit.

CUDA Build Error with CUDA 5.5.targets [duplicate]

The CUDA FAQ says:
CUDA defines vector types such as float4, but doesn't include any
operators on them by default. However, you can define your own
operators using standard C++. The CUDA SDK includes a header
"cutil_math.h" that defines some common operations on the vector
types.
However I can not find this using CUDA SDK 5.0. Has it been removed/renamed?
I've found a version of the header here. How is it related to the one that's supposed to come with SDK?
The cutil functionality was deleted from the CUDA 5.0 Samples (i.e. the "SDK"). You can still download a previous SDK and compile it under CUDA 5, you should then have everything that came with previous SDK's.
The official notice was given by nvidia in the CUDA 5.0 release notes (CUDA_Samples_Release_Notes.pdf, installed with the samples). As to why, I imagine that the nvidia sentiment regarding cutil probably was something like what is expressed here "not suitable for use in a real application. It is completely unsupported" but people were using it in real applications. So one way to try put a stop to that is to delete it, I suppose. That's just speculation.
Note some additional useful info provided in the release notes:
CUTIL has been removed with the CUDA Samples in CUDA 5.0, and replaced
with helper functions found in NVIDIA_CUDA-5.0/common/inc:
helper_cuda.h, helper_cuda_gl.h, helper_cuda_drvapi.h,
helper_functions.h, helper_image.h, helper_math.h, helper_string.h,
helper_timer.h
These helper functions handle CUDA device
initialization, CUDA error checking, string parsing, image file
loading and saving, and timing functions. The CUDA Samples projects no
longer have references and dependencies to CUTIL, and now use these
helper functions going forward.
So you may find useful functions in some of those header files.
in latest SDK helper_math.h implement most of required operator, however its still missing logical operators like OR or AND

Does Doxygen support C++/CX syntax?

Doxygen seems confused by some C++/CX syntax constructs (the new C++ extensions introduced by Microsoft for Windows 8 development). Is this a known issue? Are there patches to make it work? Or a better doc system to use? (Bear in mind that the code base in question also runs on non-Microsoft platforms.)
Doxygen supports C++/CLI. The C++/CX syntax for declarations is (nearly?) identical to the C++/CLI syntax, so enabling C++/CLI support in the Doxygen options should work fine.

C++/CLI with Pure Mode?

I have read in Foundations of C++ CLI the following:
If you try to compile a native C++
application with /clr:pure, it will
work only if the code being compiled
has no constructs that generate
machine-specific code. You can,
however, link with native libraries.
What is meant by "constructs that generate machine-specific code" ? Example?
Also the book says that this mode is not verifiably safe, so we can use pointers for example, now i am confusing in how can say that the compiler will produce pure MSIL code and also we can use pointers! What i know is that, the pointer is somehow native concept! how it will be made as pure MSIL!?
MSIL is quite powerful, it has no trouble with standard compliant C++03 code. The only "constructs" I know of that it cannot deal with is the __fastcall calling convention, r-value references as implemented in the C++0x additions in VS2010 and obvious machine specific extensions like the __asm keyword (inline assembly) and intrinsics.
Most any native C++ you compile with /clr in effect will use pointers, either explicitly or compiler-generated to implement things like C++ classes and references. MSIL has no trouble with it but that code is not verifiable, any MSIL that uses pointers is rejected by the verifier. This is not necessarily a problem, lots of code runs in full-trust. You'll only get in trouble when you try to run it on sandboxed execution environments, like a browser, a phone or a game console. Or when your customer has a nervous system administrator.
Using /clr:pure is otherwise pretty useless. The point of using C++/CLI is for its great support for interop with native code. Compiling native code to MSIL is largely a waste, the JIT optimizer can't do as effective a job as the native code optimizer.

c++ xcode debugging locals in constructors

I'm developing a c++ application with Xcode 3.1.4
while debugging, if i step into a constructor, i see only the membervariables, but no locals used in the constructor.
does anyone know that problem and how to solve it?
I saw somewhere else that -gstabs+ solves a similar problem specific to locals in constructors. I didn't try it but the solution that worked for me was to move the body of the code into a private function with the same arguments, and call that function from the constructor. Same behavior, but now you can debug the code...
It may be a bug in the compiler such as this one. You could try upgrading your g++ or using a different compiler.
Obvious question: you're running with no optimizations (-O0), correct? With optimizations, it is very common for local variables to be optimized out. Even without optimizations, I have found that a lot of simple C++ seems to get hidden. For instance, you can't always call get() on a shared_ptr because it gets inlined.
I recommend upgrading to Xcode 3.2. I feel that C++ support improved somewhat between 3.1 and 3.2. That said, C++ support within Xcode is still very weak. Unless you need the portability of C++ (as I do), I do not recommend developing Mac or iPhone apps in C++. You will fight the system all day. It is far better to just learn ObjC and use it (besides, ObjC really is a very powerful language and works extremely well with Cocoa). Even when you need the portability of C++, I recommend isolating the C++ code into a core and wrapping it up in Objective-C.
In no case should you use much ObjC++. gdb gets extremely confused in my experience with ObjC++. If you're going to write in C++, wrap your ObjC. If you're going to write in ObjC, wrap your C++. But don't try to write in both at the same time if you ever plan to use the debugger.

Resources