Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have been experimenting with OpenCL for quite a few days now, I'm using AMD's SDK and I'm now able to run a simple kernel in parallel and passing input/output to/from it.
I have to say though that I'm very disappointed by the lack of proper documentation for it, CUDA seems much more mature than OpenCL, but I cannot use CUDA because I don't have nVidia and because I want portable code.
I have read that AMD's OpenCL SDK now supports "static C++" extension which allows you to have some C++ features for writing the kernels, like inheritance and passing classes instances from the host to the device. However I cannot find ANY documentation for that or any examples.
To be short, my question is:
Where can I find documentation about using OpenCL's static C++ extension?
An extra question would be, where can I find PROPER documentation for the C++ wrapper (1.2 and not 1.1)
a super extra (:P) question would be, is there any complete/mature C# wrappers for OpenCL 1.2?? so far I found OpenCL.NET which is working fine, but again it doesn't have documentation so I have to look at the OpenCL C Reference and try to find the equivalent in C#
Thanks for reading this, I understand it's kind of ambiguous, all I want is an easy to use OpenCL SDK with proper documentation (Except C of course, I hate using plain C).
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am writing a program that utilises a c# sdk. The functionality of this program will be used in a larger program written in c++ using QtCreator. I would like to create a c# dll to interact with the sdk and then consume this in the c++ program. Has anyone done this before and can point me in the right direction.
Many thanks.
You can, I do this regularly at work. You can consume C# from C++ using COM and Interop. Worth noting now that this is all windows only.
If you've not used COM from C++ before you are in for a nasty surprise. It's fairly unpleasant.
This is a very big topic, so I can't really cover it in a post, but if you want to learn more, I'd look here for starting on the C++ side:
COM(C++) programming tutorials?
I'd recommend using ATL to make your COM life a lot easier.
EDIT: Actually I didn't know this, but Qt has COM support, so you'd be much better off using that - Have a look at https://doc.qt.io/qt-5.10/activeqt-index.html
Google around for the C# side, but it's mostly about using the ComVisible and Guid attributes on your classes to make them COM ready and then registering them using regasm.exe (Part of the .NET Framework).
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I have a few .NET portable libraries written in C# which I need to port to Qt (C++). Since many of the classes don't really depend on .NET framework classes to a large extent, I thought it would be good strategy to use a tool to convert the C# code to Managed C++ first and then use that as the base for the porting it for use in Qt rather than rewriting the whole thing in C++
Are there any free tools to convert C# code or decompile a built assembly to Managed C++?
Since many of the classes don't really depend on .NET framework classes to a large extent, I thought it would be good strategy to use a tool to convert the C# code to Managed C++ first and then use that as the base for the porting it for use in Qt rather than rewriting the whole thing in C++
This is an error in reasoning. Managed C++ is not C++. Just because they're syntactically similar does not make the process of moving code across easier, on the contrary, you're making things unnecessarily harder for yourself.
The first thing that comes to mind is memory management. Your Managed C++ project will use GC object references (the ^ type) which cannot be easily converted to C++ memory-management semantics, nor is this something that can be done automatically unless you have your own Garbage Collection library you're prepared to weave into your existing program.
There is more to .NET than the framework classes, but consider the runtime environment. I've already touched on the GC, but what about Exceptions? Threading? The ABI? And so on.
You're better off rewriting it in pure idiomatic C++ rather than creating a mess that tries to straddle the CLR and pretend-C++.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
So we have this Image processing course at the university and we'll be using OpenCV extensively. Problem is, OpenCV uses C++ but I'm much more fluent in C# than C++. I know that there are wrappers for OpenCV (OpenCVDotNet, SharperCV, EmguCV,...) But I don't know which to choose.
My questions are :
Which one wraps most/all of OpenCV functionality ?
Are they even worth using ? (May not be updated often, lack functionality or speed,...)
Or should I be better off brushing my C++ skills?
Note : I know that my question is a possible duplicate of this one but it's old (from 2008) and things may have changed.
I have not used EmguCV, but I have used OpenCV for a while now.
From SharperCV's website:
The Emgu CV.Net wrapper is our current recommendation if you want to use OpenCV.
And, OpenCVDotNet looks more like an academic sandbox, so if it were me, I would use EmguCV for any of my research projects that involved C#. Mainly because it is being actively maintained, and it has the most features of the available wrappers today.
I had tried EmguCV. The range of functionalities it supports is fine. But if your project is something in which the speed is an issue, then it would be better to brush up your C++ skills.
I do not know much about other wrappers. I was in your same position once. I worked in emgucv during my academics and had to shift to c++ in my profession.
Believe me, you wont find it too difficult to move onto C++.
As an update, I can corroborate the answers previously given.
I have used both OpenCV with C++ and the EMGU Wrapper for both research and work and I agree partially with most people.
EMGU CV can be easy to learn and your code will be much easier to understand, it will require less lines of code and there is a decent range of functions you can call. But it is not complete.
Many functions will not provide all the originally intended functionality that you will find with OpenCV 3.0 e.g. FindNonZero() does not work exactly the same as the function that is wrapping and SetValue() gave me a hard time throwing runtime errors difficult to debug.
On the other hand, OpenCV provides great support compared to any other Wrapper you might find online and you will be working with the most up-to-date libraries. OpenCV 3.1 is a great release and I found no problems running it on Xcode or Visual Studio.
Therefore, I would recommend anyone wanting to immerse themselves into Computer Vision and Image Processing to go straight for OpenCV C++. If you just want to work on less complex problems you can opt for EMGU (I cannot recommend others as I am not familiar).
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Is there a wrapper class somewhere for WIA/TWAIN functionality in a C# application?
Every search I make points to the same old 2001 CodeProject page, there has to be something new out there, right?
Maybe I'm not looking in the right place. :P
I need something really simple, like:
Image myImage = wiaWrapper.GetImageFromScanner();
Done and done.
Any guidance?
TwainDotNet
I've wrapped up the code from Thomas Scheidegger's article (CodeProject: .NET TWAIN image scanning) into a GitHub project.
I've cleaned up the API a bit, added WPF support and several people have added other improvements. I've tried to keep the API simple but it is still a bit more complicated that what you've got there.
Also this question has some other options: .NET Scanning API
Besides TwainDotNet maintained by Luke, I have recently noticed NTwain on NuGet (project page on Bitbucket).
Disclaimer: I work for Atalasoft
We publish DotTwain, which is a .NET TWAIN SDK. It's royalty-free and is used in InspectorTWAIN.com to help certify TWAIN drivers (we're members of the TWAIN working group).
Our product is a .NET Assembly that wraps interop calls.
You could also take a look at EZTwain from Dosadi, which is free. I don't know how native the .NET support is, but they have a way of calling from .NET.
As for a WIA C# wrapper, I came across ScanWIA on Codeplex. It doesn't have a whole lot of documentation. However, reading the source code might help.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I got my hands on some well documented C++ code that's about 1KLOC. It would take me a significant amount of time to port this line by line and debug the results, so I'm wondering if there are tools or ways to do it faster, and I have questions in case I have to do it fully manually.
Specific questions:
Does C# also support overriding operators like * and +?
What to do with the C++ memory management code like alloc() and free()?
How to identify functions used from <stdio.h>, <conio.h> and <math.h>?
How to find replacements to such system functions?
Does C# have any special/open source libraries that provide such functions?
No graphics libraries have been used, its purely command line based.
You might want to try this tool and see if that works out for you. There is a demo where you translate up to a 100 lines of code at a time:
http://tangiblesoftwaresolutions.com/Product_Details/CPlusPlus_to_CSharp_Converter_Details.html
Try it out and let us know. But it would prolly be more beneficial to port this yourself in c# so you can get a handle of the features that c# comes with.
You will need to do it manually, and 1KLOC isn't much.
However, you will need to learn C#.
To answer your questions:
Yes
Depending on what you're doing, probably List<T>
I don't know what you're asking
Look in the .Net Framework class library on MSDN
Yes
1 - C# also support operator overloading see : http://msdn.microsoft.com/en-us/library/aa288467(VS.71).aspx (it looks very much to c++ operator overriding)
2 - C# is garbage collected so you only need "new" instead of alloc. free is done by the garbage collector
3 - I have no idea , but when porting code you would have to find in standard c# library the equivalents
4 - In MSDN there is a lot of information.
5 - ( http://code2code.net/ ) ??? but better to do it at hand
More information on coding standards : http://msdn.microsoft.com/en-us/library/xzf533w0.aspx
ie naming: http://msdn.microsoft.com/en-us/library/x2dbyw72.aspx