我可以在C#中使用OpenCL提出HTTP请求吗?

发布于 2025-01-17 09:38:59 字数 117 浏览 3 评论 0原文

我可以在C#中使用OpenCL提出HTTP请求吗?我尝试执行此调用system(“ curl weblity.com”),但仅遇到有关System隐式呼叫的错误。

Can I make HTTP requests using OpenCL in C#? I tryed to do this calling system("curl website.com") but only getting an error about system implicit calling.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不气馁 2025-01-24 09:38:59

不,你不能。 OpenCL 内核 C/C++ 语言不支持标准 C 库 - 该库被一组面向数学编程的自定义标准函数所取代。

可以在内核语言中使用的函数列表可以找到 此处

No, you can't. The OpenCL kernel C/C++ language doesn't support the standard C library - this library is replaced by a custom set of standard functions, geared toward math programming.

The list of functions, which can be used in the kernel language, can be found here.

以歌曲疗慰 2025-01-24 09:38:59

正如其他人所说的那样,不,在Opencl内核中不可能进行I/O。

而且,这样做是没有意义的。 OpenCL专门从事计算密集的大规模并行数据处理。等待I/O完成将完全击败它的观点。通常的模式是:

  1. 在主机环境中收集和准备数据(常规基于CPU的编程环境;在您的情况下听起来像C#,尽管这还
  2. 不清楚
  3. ?缓冲区
  4. 从主机上的缓冲区读取结果。
  5. 进一步处理结果,例如在主机上写入磁盘,网络或显示。

As others have said, no, it's not possible to do I/O in OpenCL kernels.

Moreover though, it makes no sense to do so; OpenCL is specialised on computationally-intensive massively parallel data processing. Waiting for I/O to complete would entirely defeat the point of it. The usual pattern is:

  1. Collect and prepare your data in the host environment (regular CPU based programming environment; sounds like C# in your case although that's not entirely clear?)
  2. Create OpenCL buffers and fill them with the data
  3. Perform computation in kernels
  4. Put results in buffers
  5. Read back results from the buffers on the host.
  6. Further processing of results, e.g. writing to disk, network, or display on the host.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文