Code Monkey home page Code Monkey logo

fortrancl's Introduction

FortranCL is an OpenCL interface for Fortran 90. It allows programmers
to call OpenCL directly from Fortran. Kernels are still written in C.

The interface is designed to be as close to C OpenCL interface as
possible, while written in native Fortran 90 with type checking.

The interface is not complete but provides all the basic calls
required to write a full Fortran 90 OpenCL program.

More information and updated versions can be found in the FortranCL website:

http://code.google.com/p/fortrancl/

and in Google Groups:

[email protected]
http://groups.google.com/group/fortrancl

INSTALLATION
============

To compile and install FortranCL you need a Fortran compiler (the same
you will use to compile your OpenCL Fortran code), Gfortran is a good
choice.

The basic installation procedure is to run:

./configure
make 
make install

The installation directory can be set by the --prefix configure
option. The Fortran compiler can be specified using the FC variable
and the compilation flags with the FCFLAGS variable. For example:

./configure --prefix=/opt FC=ifort FCFLAGS="-O3"

will set the installation directory to /opt and the Fortran compiler
to ifort with the -O3 flag.

See the INSTALL file for more details.

USING FORTRANCL
===============

To use FortranCL in a Fortran program you need to include the 'cl'
module (i.e. add the 'use cl' statement to your code). You might need
to tell your compiler to look for modules files in <prefix>/include
(where <prefix> is the FortranCL installation directory, /usr/local by
default).

To link you have to add "-L<prefix>/lib -lfortrancl -lOpenCL" to the
link command, replacing <prefix> by the FortranCL installation
directory.

This is a single file compilation example assuming FortranCL was
installed in /usr/local:

gfortran prog.f90 -o prog -I/usr/local/include -L/usr/local/lib -lfortrancl -lOpenCL

See the example.f90 file for an example on how to use FortranCL to
write an OpenCL program.

FORTRANCL INTERFACE
===================

The interface of FortranCL is designed to be as close as possible to
the C OpenCL interface as possible, but taking advantage of Fortran
features like polymorphism. It was originally written for the
integration of OpenCL in the Octopus code
(http://tddft.org/programs/octopus/).

Many calls are missing, but the interface is complete enough to write
a full OpenCL code in Fortran.

This is an alpha release, our aim is to keep the interface unchanged
 for future releases but this is not guaranteed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.