GithubHelp home page GithubHelp logo

Comments (38)

tugrul512bit avatar tugrul512bit commented on June 12, 2024

Hi, can you write here the code you are tring to run? Seems like a usage error? Or my documentation error?

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

Are you using threading binaries maybe that .net version only uses own threading dlls?

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

Lazy builds were built on an FX8150. You may be missing some opportunities too, if you are on a new CPU, on top of some compiled code incompatibilities.

from cekirdekler.

rajxabc avatar rajxabc commented on June 12, 2024
public int ckmulti()
        {
            ClNumberCruncher gpu = new ClNumberCruncher(AcceleratorType.GPU | AcceleratorType.CPU, @"
    __kernel void test0(__global float * a)
    { 
        int i=get_global_id(0);
        a[i]+=3.1415f;
    }
");
            
        ClArray<float> f = arrayOfPIs;
            f.compute(gpu, 1, "test0", 1024);

            return 777;
        }

from cekirdekler.

rajxabc avatar rajxabc commented on June 12, 2024

it is same code works with "cekirdekler_dll_v1_4_1_opencl_1_2_" .
and one more question please.
how to pass const int parameter, nextParam allows only arrays .
for ex :

__kernel void
ScalarProd(
__global double * v1,
int v2)
{
int i = get_global_id(0);
v1[i] = v1[i] * v2;
}

            ");

from cekirdekler.

rajxabc avatar rajxabc commented on June 12, 2024

esxception

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

Does arrayOfPIs work with older version but not with newer version? Is it something about constructors? Does ckMulti() get used in a constructor of main program?

from cekirdekler.

rajxabc avatar rajxabc commented on June 12, 2024

yes , it works with older version perfectly.

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

The thing about "const scalar parameters" were not implemented. Currently only arrays are included. If you have 80 int parameters, single int array of length 80 will do the job although with less readability.

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

I'll try that .net version today(or within 1 2 hours) and put results here.

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

It could be AcceleratorType.GPU | AcceleratorType.CPU parameter error too.

from cekirdekler.

rajxabc avatar rajxabc commented on June 12, 2024

alright Tugrul, thank you.

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

I have .net 4.5 and this works:

using System;
using System.Collections.Generic;
using System.Text;
using Cekirdekler;
using Cekirdekler.ClArrays;

namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
        {
            MyTester myTester = new MyTester();
            myTester.ckmulti();
        }
    }

    class MyTester
    {
        float[] arrayOfPIs = new float[1024];
        public int ckmulti()
        {
            ClNumberCruncher gpu = new ClNumberCruncher(AcceleratorType.GPU | AcceleratorType.CPU, @"
    __kernel void test0(__global float * a)
    { 
        int i=get_global_id(0);
        a[i]+=3.1415f;
    }
");

            ClArray<float> f = arrayOfPIs;
            f.compute(gpu, 1, "test0", 1024);
            Console.ReadKey();
            return 777;
        }


    }
}

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

4.6.1 works too

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

Is that a new update for windows or can it be specifically installed(4.7)? I'm on vs2015 currently.

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

Or maybe you are using vs2017+ ?

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

Can you check what exists in bottom of quick watch window? Is it a dll or something else?

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

Also for the const scalar parameters, you are already creating a string for opencl. This can include global parameters in kernel compilation body instead of kernel header.

const int globalValue=@@@editGlobal1@@@; // replace with constant
void kernel .....(){ ... globalValue.. }

And this will not cause bugs when there are 50-60 constant parameters because Nvidia/Amd GPUs have a limit on kernel parameters like 4kB or something. But only 1 array costs only 4-8 bytes for all parameters it includes.

from cekirdekler.

rajxabc avatar rajxabc commented on June 12, 2024

yes it is vS2017,
which version did you use ?
from these ?
cekirdekler_dll_v1_4_1_opencl_2_0_update2.rar
cekirdekler_dll_v1_4_1_opencl_2_0_update3.rar
cekirdekler_dll_v1_4_1_opencl_2_0_update5.rar

"
Exception thrown: 'System.NullReferenceException' in Cekirdekler.dll
An unhandled exception of type 'System.NullReferenceException' occurred in Cekirdekler.dll
Object reference not set to an instance of an object.

"

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

If you add gpu.lastComputePerformanceReport(); before Console.readkey() you can see if it sees your devices like:



Compute-ID: 1  ----- Load Distributions:  [50.0%] - [50.0%] -----------------------------------------------------
Device 0(stream): Quadro K420                      ||| time: 44.86ms, workitems: 512
Device 1(stream): Quadro K420                      ||| time: 44.95ms, workitems: 512
-----------------------------------------------------------------------------------------------------------------

just to make sure that version sees devices.

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

I'm using last versionof cekirdekler and vs2015 with .net 4.6.1.

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

Did you include system threading . dll into your references?

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

What happens if you don't include system threading .dll but include .net 4.7's own threading?

from cekirdekler.

rajxabc avatar rajxabc commented on June 12, 2024

gpu.lastComputePerformanceReport();
throws ....
No OpenCL-capable device was found.

Exception thrown: 'System.NullReferenceException' in Cekirdekler.dll
An unhandled exception of type 'System.NullReferenceException' occurred in Cekirdekler.dll
Object reference not set to an instance of an object.

from cekirdekler.

rajxabc avatar rajxabc commented on June 12, 2024

ok i will UN- reference the threading dll and check

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

Seems like opencl 2.0 problem too.

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

What you successfully run was only opencl 1.2 right?

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

The unworkable error message could be coming from "release" compiled dlls. Those will tell wrong error messages when debugged.

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

You should really use the source code to compile for your own machine, on debug if you want debugging and on release if you need performance(with optimizations and unsafe code enabled). (both kutuphane.dll project and cekirdekler.dll project)

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

I wrote this project to learn C# actually. There could be some basic errors about C# or its 2017+ versions.

from cekirdekler.

rajxabc avatar rajxabc commented on June 12, 2024

I tried all these
cekirdekler_dll_v1_4_1_opencl_2_0_update2.rar
cekirdekler_dll_v1_4_1_opencl_2_0_update3.rar
cekirdekler_dll_v1_4_1_opencl_2_0_update5.rar

with reference to threading dll and and without .
they don't work .
Yes opencl 1.2 works.

I have VS2017 .Net4.7 .
Thank you for the effort and suggestions .
i will use opencl1.2 version.

Thank you

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

Do you have opencl 2.0 drivers? What is your device? An intel igpu?

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

Project was designed to filter experimental drivers out (for opencl 2.0). If yours have one, this could be that.

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

Or maybe if its nvidia, and if its an old gpu, it may not have support for 2.0 without new drivers.

from cekirdekler.

rajxabc avatar rajxabc commented on June 12, 2024

PC1: intel Core i7 2600 + Geforce GT 710
PC2: AMD Ryzen 7 1800x + Geforce GTX 1060 3GB

all updated driver and Opencl 2.0

Tried to build Kutuphane on my device,
"E1696 cannot open source file "CL/cl2.hpp" KutuphaneCL2"

some opencl2 sdk issue.

from cekirdekler.

rajxabc avatar rajxabc commented on June 12, 2024

Thank you Tugurul for your effort and suggestion.
i will use opencl 1.2 version for my tests.

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

Then opencl2.0 directory is different imo.
(opencl must have changed a lot since project was built)

When you need to use opencl 2.0, just rename kutuphanecl2.dll to kutuphanecl.dll because cekirdekler.dll uses it. (when opencl 2.0 drivers etc are solved)

I'm very sorry for this issue(You'll be missing only dynamical parallelism). I'll try to solve this when I have a ryzen+ vs2017+ system.

from cekirdekler.

tugrul512bit avatar tugrul512bit commented on June 12, 2024

cl2.hpp here https://github.com/tugrul512bit/CekirdeklerCPP2/tree/master/KutuphaneCL2/KutuphaneCL2/CL

from cekirdekler.

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.