This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

oclminify is an OpenCL™ source minifier. It takes OpenCL source code and makes it as small as possible by stripping comments, removing unnecessary space, renaming symbols, rewriting vector indices, etc. The minified source can be optionally compressed and then saved as is or as a C header. The latter makes it very easy to embed into a compiled application. The original source and the minified source are functionally identical and should compile into the exact same byte code.

If you’re targeting platforms with OpenCL 2.0 or later support, you should consider using SPIR™ instead.

oclminify was originally developed by the Phoduit team.

Prerequisites

  • Python® >= 2.7 (Python 3 is also supported)
  • pycparser >= 2.14 (github version is recommended if you need #pragma support)
  • pycparserext >= 2016.1
  • pyopencl >= 2016.1 (optional, checks if source can be compiled before minifying)
  • GCC, cpp, MSVC or another C preprocessor

Install

>From the command line:

pip install oclminify

If you want oclminify to support a compile check before minification, with an actual OpenCL driver, install pyopencl with:

pip install pyopencl

Usage

oclminify [-h] [--preprocessor-command PREPROCESSOR_COMMAND]
          [--preprocessor-no-stdin] [--no-preprocess] [--no-minify]
          [--compress] [--strip-zlib-header] [--header]
          [--header-function-args] [--minify-kernel-names]
          [--global-postfix GLOBAL_POSTFIX] [--try-build]
          [--output-file OUTPUT_FILE]
          input

oclminify takes a single input file. If the input file is - (a single hyphen), input will be read from STDIN. If the –output-file option is omitted, the output is written to STDOUT.

The available options are:

-h, --help            show this help message and exit
--preprocessor-command PREPROCESSOR_COMMAND
                      Command to preprocess input source before
                      minification. Defaults to "gcc -E -undef -P -std=c99
                      -"
--preprocessor-no-stdin
                      Pass input to preprocessor using a temporary file
                      instead of stdin.
--no-preprocess       Skip preprocessing step. Implies --no-minify.
--no-minify           Skip minification step. Useful when debugging.
--compress            Compress output using zlib.
--strip-zlib-header   Strips the two byte zlib header from the compressed
                      output when --compress is used.
--header              Embed output in a C header file.
--header-function-args
                      Include function argument mappings in C header file.
--minify-kernel-names
                      Replace kernel function names with shorter names.
--global-postfix GLOBAL_POSTFIX
                      Postfix appended to each symbol name in the global
                      scope. Used for preventing name collisions when
                      minifying multiple source files separately. Implies
                      --minify-kernel-names.
--try-build           Try to build the input using an OpenCL compiler before
                      minifying. The compiled output is discarded. Requires
                      pyopencl.
--output-file OUTPUT_FILE
                      File path where output should be saved. Omit to write
                      to stdout.

Examples

To simply minify an OpenCL source file and write the result to file, run:

oclminify --output-file output.minified.cl input.cl

The examples directory contains more examples:

  • examples/minimal — shows how to create a minimal project that minifies an OpenCL source file and builds a C based project using a shell script.
  • examples/cmake — shows how to integrate oclminify with a CMake based C++ project.
  • examples/compress — shows how to use oclminify in a CMake project to compress an OpenCL source file at compile time and then decompress it at run time.
Release History

Release History

0.7.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.6.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
oclminify-0.7.0-py2.py3-none-any.whl (29.0 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Sep 27, 2016
oclminify-0.7.0.tar.gz (29.2 kB) Copy SHA256 Checksum SHA256 Source Sep 27, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting