当前位置: 首页>>代码示例>>C++>>正文


C++ CAMLparam1函数代码示例

本文整理汇总了C++中CAMLparam1函数的典型用法代码示例。如果您正苦于以下问题:C++ CAMLparam1函数的具体用法?C++ CAMLparam1怎么用?C++ CAMLparam1使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了CAMLparam1函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: caml_picosat_assume

CAMLprim value caml_picosat_assume(value lit) {
    CAMLparam1 (lit);
    picosat_assume(Int_val(lit));
    CAMLreturn(Val_unit);
}
开发者ID:abate,项目名称:ocaml-picosat,代码行数:5,代码来源:libpicosat_stubs.c

示例2: sdlimagestub_init

CAMLprim value sdlimagestub_init(value flags)
{
	CAMLparam1(flags);
	IMG_Init(Initflags_val(flags));
	CAMLreturn(Val_unit);
}
开发者ID:einars,项目名称:glcaml,代码行数:6,代码来源:sdl_image_stub.c

示例3: caml_initialize_readline

/*
 * Nothing to initialize :)
 */
value caml_initialize_readline(value unit) {

   CAMLparam1(unit);
   CAMLreturn(Val_unit);

}
开发者ID:camlspotter,项目名称:my-ocaml-win,代码行数:9,代码来源:lm_readline.c

示例4: ml_QObjectCleanupHandler_isEmpty_0

//bool isEmpty() const ;
value ml_QObjectCleanupHandler_isEmpty_0(value self) {
	CAMLparam1 (self);
	CAMLlocal1(calling_result);
	calling_result = Val_bool (((QObjectCleanupHandler*)self) ->  isEmpty());
	CAMLreturn(calling_result);
}
开发者ID:dm04806,项目名称:lablqt,代码行数:7,代码来源:ml_QObjectCleanupHandler.cpp

示例5: brlapiml_setExceptionHandler

/* exception occurs */
CAMLprim value brlapiml_setExceptionHandler(value unit)
{
  CAMLparam1(unit);
  brlapi_setExceptionHandler(raise_brlapi_exception);
  CAMLreturn(Val_unit);
}
开发者ID:Feechka,项目名称:UOBP,代码行数:7,代码来源:brlapi_stubs.c

示例6: llvm_genericvalue_of_int32

/* Llvm.lltype -> int32 -> t */
CAMLprim value llvm_genericvalue_of_int32(LLVMTypeRef Ty, value Int32) {
  CAMLparam1(Int32);
  CAMLreturn(alloc_generic_value(
    LLVMCreateGenericValueOfInt(Ty, Int32_val(Int32), 1)));
}
开发者ID:aosm,项目名称:clang,代码行数:6,代码来源:executionengine_ocaml.c

示例7: lwt_unix_invalidate_dir

CAMLprim value lwt_unix_invalidate_dir(value dir)
{
    CAMLparam1(dir);
    DIR_Val(dir) = NULL;
    CAMLreturn(Val_unit);
}
开发者ID:ocsigen,项目名称:lwt,代码行数:6,代码来源:unix_invalidate_dir.c

示例8: caml_bgzf_open_in

value caml_bgzf_open_in(value fn) {
	CAMLparam1(fn);
	BGZF *bgzf = bgzf_open(String_val(fn),"r");
	if(bgzf == NULL) caml_failwith("BGZF.open_in");
	CAMLreturn(alloc_bgzf(bgzf));
}
开发者ID:mlin,项目名称:ocaml-bgzf,代码行数:6,代码来源:bgzf_stubs.c

示例9: caml_bgzf_close_in

value caml_bgzf_close_in(value bgzf) {
	CAMLparam1(bgzf);
	bgzf_close(BGZF_val(bgzf));
	CAMLreturn(Val_unit);
}
开发者ID:mlin,项目名称:ocaml-bgzf,代码行数:5,代码来源:bgzf_stubs.c

示例10: caml_ptrace_detach

CAMLprim value caml_ptrace_detach(value pid) {
    CAMLparam1(pid);
    int res = ptrace(PTRACE_DETACH, Int_val(pid), NULL, NULL);
    CAMLreturn(Val_int(res));
}
开发者ID:andersfugmann,项目名称:revisor,代码行数:5,代码来源:extern.c

示例11: bap_disasm_backend_name_stub

/* alloc */
value bap_disasm_backend_name_stub(value n) {
    CAMLparam1(n);
    CAMLlocal1(s);
    s = caml_copy_string(bap_disasm_backend_name(Int_val(n)));
    CAMLreturn(s);
}
开发者ID:BinaryAnalysisPlatform,项目名称:bap,代码行数:7,代码来源:disasm_stubs.c

示例12: caml_ptrace_seize

CAMLprim value caml_ptrace_seize(value pid) {
    CAMLparam1(pid);
    int res = ptrace(PTRACE_SEIZE, Int_val(pid), NULL, NULL);
    CAMLreturn(Val_int(res));
}
开发者ID:andersfugmann,项目名称:revisor,代码行数:5,代码来源:extern.c

示例13: spoc_getCudaDevice

value spoc_getCudaDevice(value i)
{
	CAMLparam1(i);
	CAMLlocal4(general_info, cuda_info, specific_info, gc_info);
	CAMLlocal3(device,  maxT, maxG);
	int nb_devices;
	CUdevprop dev_infos;
	CUdevice dev;
	CUcontext ctx;
	CUstream queue[2];
	spoc_cu_context *spoc_ctx;
	//CUcontext gl_ctx;
	char infoStr[1024];
	int infoInt;
	size_t infoUInt;
	int major, minor;
	enum cudaError_enum cuda_error; 


	cuDeviceGetCount (&nb_devices);

	if ((Int_val(i)) > nb_devices)
		raise_constant(*caml_named_value("no_cuda_device")) ;


	CUDA_CHECK_CALL(cuDeviceGet(&dev, Int_val(i)));
	CUDA_CHECK_CALL(cuDeviceGetProperties(&dev_infos, dev));

	general_info = caml_alloc (9, 0);
	CUDA_CHECK_CALL(cuDeviceGetName(infoStr, sizeof(infoStr), dev));

	Store_field(general_info,0, copy_string(infoStr));//
	CUDA_CHECK_CALL(cuDeviceTotalMem(&infoUInt, dev));

	Store_field(general_info,1, Val_int(infoUInt));//
	Store_field(general_info,2, Val_int(dev_infos.sharedMemPerBlock));//
	Store_field(general_info,3, Val_int(dev_infos.clockRate));//
	Store_field(general_info,4, Val_int(dev_infos.totalConstantMemory));//
	CUDA_CHECK_CALL(cuDeviceGetAttribute(&infoInt, CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT, dev));
	Store_field(general_info,5, Val_int(infoInt));//
	CUDA_CHECK_CALL(cuDeviceGetAttribute(&infoInt, CU_DEVICE_ATTRIBUTE_ECC_ENABLED, dev));
	Store_field(general_info,6, Val_bool(infoInt));//
	Store_field(general_info,7, i);
	CUDA_CHECK_CALL(cuCtxCreate	(&ctx,
			CU_CTX_SCHED_BLOCKING_SYNC | CU_CTX_MAP_HOST,
			dev));
	spoc_ctx = malloc(sizeof(spoc_cl_context));
	spoc_ctx->ctx = ctx;
	CUDA_CHECK_CALL(cuStreamCreate(&queue[0], 0));
	CUDA_CHECK_CALL(cuStreamCreate(&queue[1], 0));
	spoc_ctx->queue[0] = queue[0];
	spoc_ctx->queue[1] = queue[1];
	Store_field(general_info,8, (value)spoc_ctx);
	CUDA_CHECK_CALL(cuCtxSetCurrent(ctx));


	cuda_info = caml_alloc(1, 0); //0 -> Cuda
	specific_info = caml_alloc(18, 0);

	cuDeviceComputeCapability(&major, &minor, dev);
	Store_field(specific_info,0, Val_int(major));//
	Store_field(specific_info,1, Val_int(minor));//
	Store_field(specific_info,2, Val_int(dev_infos.regsPerBlock));//
	Store_field(specific_info,3, Val_int(dev_infos.SIMDWidth));//
	Store_field(specific_info,4, Val_int(dev_infos.memPitch));//
	Store_field(specific_info,5, Val_int(dev_infos.maxThreadsPerBlock));//

	maxT = caml_alloc(3, 0);
	Store_field(maxT,0, Val_int(dev_infos.maxThreadsDim[0]));//
	Store_field(maxT,1, Val_int(dev_infos.maxThreadsDim[1]));//
	Store_field(maxT,2, Val_int(dev_infos.maxThreadsDim[2]));//
	Store_field(specific_info,6, maxT);

	maxG = caml_alloc(3, 0);
	Store_field(maxG,0, Val_int(dev_infos.maxGridSize[0]));//
	Store_field(maxG,1, Val_int(dev_infos.maxGridSize[1]));//
	Store_field(maxG,2, Val_int(dev_infos.maxGridSize[2]));//
	Store_field(specific_info,7, maxG);

	Store_field(specific_info,8, Val_int(dev_infos.textureAlign));//
	cuDeviceGetAttribute(&infoInt, CU_DEVICE_ATTRIBUTE_GPU_OVERLAP, dev);
	Store_field(specific_info,9, Val_bool(infoInt));//
	cuDeviceGetAttribute(&infoInt, CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, dev);
	Store_field(specific_info,10, Val_bool(infoInt));//
	cuDeviceGetAttribute(&infoInt, CU_DEVICE_ATTRIBUTE_INTEGRATED, dev);
	Store_field(specific_info,11, Val_bool(infoInt));//
	cuDeviceGetAttribute(&infoInt, CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY, dev);
	Store_field(specific_info,12, Val_bool(infoInt));//
	cuDeviceGetAttribute(&infoInt, CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, dev);
	Store_field(specific_info,13, Val_int(infoInt));//
	cuDeviceGetAttribute(&infoInt, CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS, dev);
	Store_field(specific_info,14, Val_bool(infoInt));//
	cuDeviceGetAttribute(&infoInt, CU_DEVICE_ATTRIBUTE_PCI_BUS_ID, dev);
	Store_field(specific_info,15, Val_int(infoInt));
	cuDeviceGetAttribute(&infoInt, CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID, dev);
	Store_field(specific_info,16, Val_int(infoInt));
	cuDriverGetVersion(&infoInt);
	Store_field(specific_info, 17, Val_int(infoInt));

	Store_field(cuda_info, 0, specific_info);
//.........这里部分代码省略.........
开发者ID:caizongchao,项目名称:SPOC,代码行数:101,代码来源:Spoc_cu.c

示例14: caml_picosat_corelit

CAMLprim value caml_picosat_corelit(value lit) {
    CAMLparam1 (lit);
    CAMLreturn(Val_int(picosat_corelit(Int_val(lit))));
}
开发者ID:abate,项目名称:ocaml-picosat,代码行数:4,代码来源:libpicosat_stubs.c

示例15: llvm_genericvalue_of_float

/* Llvm.lltype -> float -> t */
CAMLprim value llvm_genericvalue_of_float(LLVMTypeRef Ty, value N) {
  CAMLparam1(N);
  CAMLreturn(alloc_generic_value(
    LLVMCreateGenericValueOfFloat(Ty, Double_val(N))));
}
开发者ID:aosm,项目名称:clang,代码行数:6,代码来源:executionengine_ocaml.c


注:本文中的CAMLparam1函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。