Git Product home page Git Product logo

Comments (6)

kenba avatar kenba commented on August 12, 2024

Thank you for raising this issue Jonas. Please can you provide an example?

from cl3.

Greast avatar Greast commented on August 12, 2024
use cl3::device::*;
let id = get_platform_ids().unwrap().pop().unwrap();

use cl3::platform::get_platform_ids;
let devs = &get_device_ids(id, CL_DEVICE_TYPE_DEFAULT) .unwrap()[..1];

use cl3::context::create_context;
use std::ptr::{null, null_mut};
let ctx = create_context(devs, null(), None, null_mut()).unwrap();

use cl3::program::*;
const SRC : &'static str = "__kernel void func(){}";
let program = create_program_with_source(ctx, &[SRC]).unwrap();

use std::ffi::CString;
let no_options = CString::new("").unwrap();
compile_program(program, devs, &no_options, &[], &[], None, null_mut()).unwrap();`

In this example, compile_program can return Err(-30), which is CL_INVALID_VALUE.
This occurs due to the two empty slices not necessarily pointing to address 0,
compile_program can return CL_INVALID_VALUE if, and I quote "num_input_headers is zero and header_include_names or input_headers are not NULL".

cl3::program::link_program also suffers from the same problem

from cl3.

kenba avatar kenba commented on August 12, 2024

I've fixed the empty slice issue in compile_program and added an assertion to ensure that the input_headers slice and header_include_names slice are the same length.

As for link_program , it doesn't make sense to call it with an empty input_programs slice, so I've added an assertion.

The changes are in the develop branch. Please let me know if there are any other issues.

from cl3.

Greast avatar Greast commented on August 12, 2024

I can see enqueue_nd_range_kernel suffers from the same problem regarding events

from cl3.

kenba avatar kenba commented on August 12, 2024

Sorry Jonas, but I can't see a problem with enqueue_nd_range_kernel events. They are just passed in as number and pointer parameters.

In the opencl crate, the events parameter is passed in as a slice, however, that code checks for an empty list like compile_program does now.

Any other issues?

from cl3.

kenba avatar kenba commented on August 12, 2024

Incorporated in version 0.6.5.

from cl3.

Related Issues (20)

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.