我正在尝试用UIDntu编译一个openCL程序,其中NVIDIA卡曾经使用过一次,
#include <CL/cl.h>
#include <iostream>
#include <vector>
using namespace std;
int main() {
cl_platform_id platform;
cl_device_id device;
cl_context context;
cl_command_queue command_queue;
cl_int error;
if(clGetPlatformIDs(1, &platform, NULL) != CL_SUCCESS) {
cout << "platform error" << endl;
}
if(clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 1, &device, NULL) != CL_SUCCESS) {
cout << "device error" << endl;
}
context = clCreateContext(NULL, 1, &device, NULL, NULL, &error);
if(error != CL_SUCCESS) {
cout << "context error" << endl;
}
command_queue = clCreateCommandQueue(context, device, 0, &error);
if(error != CL_SUCCESS) { …Run Code Online (Sandbox Code Playgroud) 我有一个JComboBox,每秒一次,我想从数据库中检索一组字符串,并将这些字符串设置为JComboBox的内容,其中一个作为当前选择的值.但我也希望用户能够编辑JComboBox并向数据库添加值并将其设置为当前值.
我希望能够检测到何时将字符输入JComboBox,因此我可以重置倒计时,这会阻止更新JComboBox,只要它不为零.我的第一直觉是使用KeyListener,但组合框上的Java教程说明了这一点,
虽然JComboBox继承了为低级事件(例如焦点,键和鼠标事件)注册侦听器的方法,但我们建议您不要在组合框上侦听低级事件.
他们接着说,所发射的事件可能会根据外观和感觉而改变.
我想我终于知道我想要一种编译型编程语言,一种快速的编译器。我觉得这是一件非常肤浅的事情,但在从 Java 切换到 Scala 一段时间后,我意识到能够对代码进行小的更改并立即运行程序实际上对我来说非常重要。除了 Java 和 Go 我不知道有任何语言真正重视编译速度。
c++ ×1
compilation ×1
java ×1
jcombobox ×1
linker ×1
opencl ×1
performance ×1
swing ×1
ubuntu ×1