Coder Social home page Coder Social logo

genfut's People

Contributors

athas avatar chafey avatar dignifiedquire avatar erk- avatar munksgaard avatar pema99 avatar porcuquine avatar ulrik-dk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

genfut's Issues

No error-checking when creating context

After creating a Futhark context with the C function
futhark_context_new(), the caller must immediately call
futhark_context_get_error() to determine whether initialisation
succeeded. Only if futhark_context_get_error() returns NULL
should the context be used.

Error strings are not freed

Currently in FutharkError::new the error string retrieved is not freed, but it should be according to the futhark docs

Missing error checking when freeing Futhark objects

At the C API level, freeing a Futhark value can also return an error
code. This is not exposed in the Rust code, where the return code of
the freeing functions is never checked. This is likely because the
implicit resource management implied by the Drop trait is
incompatible with checking deallocations for errors. Futhark has no
documented reason for why deallocation should ever fail, and in
practice it will only occur due to compiler bugs, or perhaps driver or
hardware malfunction, and never under normal circumstances. Yet, it
would be better to check the error code, and perform a Rust panic in
the event of deallocation error.

Tracking issue: Better coverage of C functions

Lingering lib folder

Whenever I invoke the genfut build script from the readme, I get an empty 'lib' folder lingering around in my crate root. Is that intentional?

Allow for multiple backends

Currently we only generate a single backend for a given futhark file, but there is nothing that should make it impossible to generate multiple. At the moment it will not work since we use features but that will be resolved by #31.

So to bring this change to frutition we need to have different names for each backend and then be able to select which to link and use at compile time in the generated project.

Missing deallocation of context object

The implementation of FutharkContext does not at any point call
futhark_context_free() or futhark_context_config_free(). This
means that the actual Futhark context object is not freed when the
FutharkContext Rust object is destroyed. GPU resources may thus be
leaked until the process ends entirely and they are reclaimed by the
operating system.

I recommend adding an implementation of the Drop trait for
FutharkContext, which should call futhark_context_free() and
futhark_context_config_free() (in that order). If this is done,
then the implementation of the Copy and Clone
traits should probably be removed.

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.