L25 Miniproject ideas

Detecting wrong memory access patterns for work groups in OpenCL

Project proposed by Anastasia Stulova.

Some ideas are expressed in this paper.

Basically, it’s beneficial to access memory in row-major order by the threads from the same work group. If we could implement an LLVM pass to detect inefficient accesses and perhaps also transform or investigate how to transform them it would be quite useful. Also something from related work here could be to detect memory redundant loads in work group. This occurs in applications like Sobel that operate on sliding window of data across threads in the same work group.

Discuss evaluation strategies with Anastasia.

Improve LLVM’s optimisation of atomics

A student in 2014 improved LLVM’s generation of atomics for ARM by eliding redundant barriers (Slides, Writeup). There is still a lot of scope for improvement within the allowed memory model and recent WG14 publications have enumerated some of the allowable transforms.

This project is likely to be very difficult, but has the potential for some very nice results.

Implement generic abbreviations for FuncDecl in PCH

Project proposed by Anastasia Stulova.

The current problem is that the OpenCL header (included in all OpenCL compilation units) is about 20K lines of code and when compiled to precompiled header occupies 2MB of space. This header is mainly composed of functions declarations.

PCH achieves size reduction via abbreviations but the PCH writer doesn’t abbreviate FuncDecls, mainly because they can have dynamic descriptors i.e. attributes. It might be possible to create generic (or worst case) abbreviation that would fit all FuncDecl and would be more efficient when general way of storing data.

Evaluation of this project should show space savings for the OpenCL header and should determine whether this is a net win for precompiled headers for C/C++ as well.

Extend random testing for OpenCL2.0

Project proposed by Anastasia Stulova.

CLSmith (based on CSmith) is a tool developed at Imperial College for random testing of OpenCL. It could be extend to test OpenCL 2.0 features or a subset of those. As far as I know there is a way to do it by specifying a grammar. Some papers describing the tool and how it can be extended.

OpenCL 2 support in Clang is relatively immature and so a successful outcome for this project would find and report some bugs.