Khronos Releases SPIR 1.2 Specification for Portable Encoding of OpenCL Device Programs

Open, cross-plat­form inter­me­dia­te repre­sen­ta­ti­on stan­dard for hete­ro­ge­neous com­pu­ting. Enables com­pi­ler inno­va­ti­on for a diver­se ran­ge of par­al­lel architectures 

Janu­ary 21, 2014 — HiPEAC 2014 Con­fe­rence, Vien­na – The Khro­nos™ Group today announ­ced the rati­fi­ca­ti­on and public release of the SPIR™ 1.2 spe­ci­fi­ca­ti­on that pro­vi­des a non-source enco­ding, and bina­ry level por­ta­bi­li­ty, for Open­CL™ 1.2 device pro­grams. SPIR (Stan­dard Por­ta­ble Inter­me­dia­te Repre­sen­ta­ti­on) is the industry’s first open, cross-plat­form Inter­me­dia­te Repre­sen­ta­ti­on stan­dard for por­ta­ble hete­ro­ge­neous par­al­lel com­pu­ting and is based on LLVM IR. SPIR enables deve­lo­pers to avo­id expo­sing sen­si­ti­ve ker­nel source and enables a diver­si­ty of lan­guage front-ends to easi­ly tar­get Open­CL plat­forms and devices in addi­ti­on to Open­CL C. The SPIR spe­ci­fi­ca­ti­on and regis­try can be found at http://www.khronos.org/registry/spir.

Befo­re the deve­lo­p­ment of SPIR, new tools and lan­guages for acces­sing par­al­lel acce­le­ra­ti­on on hete­ro­ge­neous sys­tems requi­red spe­ci­fic and detail­ed know­ledge to crea­te com­pi­ler back-ends for each vendor’s uni­que hard­ware archi­tec­tu­re. The SPIR stan­dard enables ven­dors to accept and acce­le­ra­te SPIR bina­ries on their hard­ware, free­ing hig­her-level lan­guages to inno­va­te across a diver­se ran­ge of plat­forms inclu­ding dis­crete acce­le­ra­tor boards, sys­tem on chips, gra­phics pro­ces­sors and FPGAs.

SPIR enables a rich eco­sys­tem of com­pi­ler midd­le­wa­re for por­ta­ble par­al­lel pro­grams by buil­ding on the strengths of LLVM and Open­CL. SPIR is a spe­cia­liza­ti­on of LLVM 3.2 IR, but also encodes Open­CL-spe­ci­fic seman­ti­cs. The cl_khr_spir stan­dard exten­si­on to Open­CL 1.2 and 2.0 defi­nes how to load a SPIR ins­tance into an Open­CL run­time. The deve­lo­p­ment of SPIR has been vali­da­ted on mul­ti­ple ven­dor imple­men­ta­ti­ons of Open­CL, and has bene­fi­ted from a tho­rough open con­sul­ta­ti­on pro­cess bet­ween Khro­nos and the LLVM and Clang communities.

In addi­ti­on to the SPIR spe­ci­fi­ca­ti­on, Khro­nos is making the fol­lo­wing open source soft­ware com­pon­ents available on Git­hub under the same licen­se as LLVM and Clang:

  • a modi­fied Clang 3.2 which gene­ra­tes SPIR from device pro­grams in Open­CL C ver­si­on 1.2;
  • a SPIR modu­le veri­fier, writ­ten in the form of an LLVM pass;
  • a hea­der file con­tai­ning defi­ni­ti­ons for all enu­me­ra­ted values in the SPIR 1.2 specification.

Fur­ther details on the­se resour­ces can be found at: https://github.com/KhronosGroup.

With the release of SPIR 1.2 and asso­cia­ted soft­ware tools, the Khro­nos Group wel­co­mes deve­lo­pers of diver­se com­pu­ting and gra­phics stacks to levera­ge SPIR for cross ven­dor por­ta­bi­li­ty and to dri­ve inno­va­ti­on on the fol­lo­wing fronts:

  • Front-ends: new lan­guage front-ends and pro­gramming abs­trac­tions for hete­ro­ge­neous par­al­lel pro­gramming can tar­get pro­duc­tion qua­li­ty Open­CL backends through SPIR;
  • Back-ends: new tar­get plat­forms based on mul­ti­co­re, vec­tor, VLIW or other tech­no­lo­gies can reu­se pro­duc­tion qua­li­ty lan­guage frontends and abstractions;
  • Too­ling: advan­ced pro­gram ana­ly­sis and opti­miza­ti­on of pro­grams in SPIR form.
    For exam­p­le, the deve­lo­pers of both Open­ACC and C++ AMP have sta­ted that they will tar­get SPIR to access opti­mi­zed back-ends across mul­ti­ple vendors.

Indus­try Support 
AMD is very exci­ted to see the Khro­nos Group fina­li­ze its SPIR 1.2 spe­ci­fi­ca­ti­on to build on the indus­try momen­tum dri­ving hete­ro­ge­neous com­pu­ting, and we expect SPIR 1.2 to help enable a broad set of pro­gramming lan­guages that take advan­ta­ge of the immense com­pu­ting capa­bi­li­ties of gra­phics hard­ware,” said Gre­go­ry Stoner, seni­or direc­tor, HSA Appli­ca­ti­on Engi­nee­ring, AMD, and Mana­ging Direc­tor of the HSA Foun­da­ti­on. SPIR 1.2 addres­ses seve­ral new fea­tures reques­ted by our deve­lo­pers, inclu­ding the abili­ty to ship Open­CL ker­nels in a bina­ry representation.”

I expect SPIR to open up many new are­as of rese­arch in hete­ro­ge­neous par­al­lel sys­tems,” said Simon McIn­tosh-Smith, Head of the Microelec­tro­nics Rese­arch Group at the Uni­ver­si­ty of Bris­tol. “A por­ta­ble inter­me­dia­te repre­sen­ta­ti­on such as this will enable the deve­lo­p­ment of exci­ting new soft­ware tools and par­al­lel lan­guages, and will thus acce­le­ra­te the adop­ti­on of next gene­ra­ti­on par­al­lel architectures.”

SPIR will be a key enabler for inno­va­ti­on in hete­ro­ge­neous com­pu­ting. Befo­re SPIR, pro­du­cing a new tool or lan­guage for acce­le­ra­ting on today’s spec­ta­cu­lar­ly powerful and effi­ci­ent hete­ro­ge­neous sys­tems would requi­re in-depth know­ledge and access to each dif­fe­rent hard­ware vendor’s archi­tec­tu­re,” said Andrew Richards, CEO of Code­play. “Now, with SPIR as an open, cross-plat­form stan­dard, we can inno­va­te across a who­le ran­ge of hard­ware archi­tec­tures. This heralds in a new era of hete­ro­ge­neous com­pu­ting and I com­mend the excel­lent work by the group put­ting this cross-ven­dor stan­dard together.”

We are exci­ted to see SPIR publicly released and belie­ve it will great­ly help Open­CL adop­ti­on by making appli­ca­ti­on deploy­ment more con­ve­ni­ent and por­ta­ble across hard­ware plat­forms,” said Jona­than Khazam, vice pre­si­dent and gene­ral mana­ger of Intel’s Visu­al & Par­al­lel Com­pu­ting Group. SPIR and Open­CL are a gre­at way to take advan­ta­ge of GPU com­pu­ting to deli­ver new expe­ri­en­ces on a wide ran­ge of com­pu­ting devices, from pho­nes and tablets to PCs.”

About The Khro­nos Group
The Khro­nos Group is an indus­try con­sor­ti­um crea­ting open stan­dards to enable the aut­ho­ring and acce­le­ra­ti­on of par­al­lel com­pu­ting, gra­phics, visi­on, sen­sor pro­ces­sing and dyna­mic media on a wide varie­ty of plat­forms and devices. Khro­nos stan­dards include OpenGL®, OpenGL® ES, Web­GL™, Open­CL™, Web­CL™, Open­VX™, Open­MAX™, OpenVG™, Open­SL ES™, Strea­mIn­put™ and COLLADA™. All Khro­nos mem­bers are enab­led to con­tri­bu­te to the deve­lo­p­ment of Khro­nos spe­ci­fi­ca­ti­ons, are empowered to vote at various stages befo­re public deploy­ment, and are able to acce­le­ra­te the deli­very of their cut­ting-edge media plat­forms and appli­ca­ti­ons through ear­ly access to spe­ci­fi­ca­ti­on drafts and con­for­mance tests. More infor­ma­ti­on is available at www.khronos.org.

###

Khro­nos, DevU, Strea­mIn­put, Web­GL, Web­CL, COLLADA, Open­KO­DE, OpenVG, Open­VX, Open­SL ES, Open­MAX, glTF and SPIR are trade­marks of the Khro­nos Group Inc. ASTC is a trade­mark of ARM Hol­dings PLC, Open­CL is a trade­mark of Apple Inc. and OpenGL is a regis­tered trade­mark and the OpenGL ES and OpenGL SC logos are trade­marks of Sili­con Gra­phics Inter­na­tio­nal used under licen­se by Khro­nos. All other pro­duct names, trade­marks, and/or com­pa­ny names are used sole­ly for iden­ti­fi­ca­ti­on and belong to their respec­ti­ve owners.