Showing posts with label opencl. Show all posts
Showing posts with label opencl. Show all posts

Monday, 3 September 2012

Not Ready Yet

Fired up my copy of iA Writer, got pandoc to make some HTML from markdown, and wrote up my toy interpreter with its byte code to OpenCL compilation. Pandoc is nifty, and can generate pretty code snippets in HTML with syntax highlighting and line numbering.

Sunday, 26 August 2012

The More I See

It is possible to use printf inside an OpenCL CPU kernel on OSX; however, remember to cast the string literal operand to (char const*) pointer to get it to compile.

Further, when running an OpenCL using program it is possible to force error logging to stdout (e.g. for .cl compile errors) via 

    CL_LOG_ERRORS=stdout program Args 

Wednesday, 22 August 2012

Disassemble

There is an offline compiler for OpenCL included in OSX 10.7, at /System/Library/Frameworks/OpenCL.framework/Versions/A/Libraries/openclc 

This is pretty much a standard clang executable, and accepts common clang options. Sample arguments of interest, 

    -O3  -x cl -triple i386-applecl-darwin -S < loop.cl

Shows the assembly code for an OpenCL kernel.

    -x cl -triple i386-applecl-darwin -emit-llvm < loop.cl

Shows the LLVM textual-IR for a kernel.

The official documentation and example of this suggest the use of generating LLVM bit code offline, for 32 and 64 bit CPU and 32 bit GPU. More useful advice included in the OpenCL Mac programming guide.

Thursday, 30 December 2010

What comes around

Lichess is a cool online chess site. Although, it is not, as it claims, open source: it places non-commercial use restrictions on the code, for example, failing the open source definition.

Its easy to write simple web applications quickly with Webpy. Can parse C99 with open source parser (pycparser) implemented in Python, and display the generated syntax tree in a web browser via JSTree. Hence a very semi-working OpenCL lint tool (just needs, hmm, a proper preprocessor, symbol table, type-checker to do this right: not going to do that outside the day job, obviously!).

The graphics support in browsers is getting better: Graphviz display in the browser via canviz, and some ease of use APIs over the HTML5 canvas (EaselJS) element.

Maze generation. Nifty CS assignments I wish I had on my course. Key events in JavaScript. If this script works, and the web-service it uses is any good, finding plane tickets should be easier.

With the somewhat more extreme climate around, weather seems more interesting. See also wview.

For journalism, and print media that 'gets' the internet, the Economist is pretty good; a print subscriber gets the same content online, and in an iPhone App, and in audio. It's rather like distilled BBC Radio 4.