static int check_pseudo_header(nghttp2_stream *stream, const nghttp2_nv *nv, int flag) { if (stream->http_flags & flag) { return 0; } if (lws(nv->value, nv->valuelen)) { return 0; } stream->http_flags |= flag; return 1; }
void bi::MarginalSISHandler<B,A,S>::handleStopperLogWeights( boost::mpi::communicator child, boost::mpi::status status) { typedef typename temp_host_vector<real>::type vector_type; double maxlw = BI_INF; /* add weights */ boost::optional<int> n = status.template count<real>(); if (n) { vector_type lws(*n); child.recv(status.source(), status.tag(), lws.buf(), *n); stopper.add(lws, maxlw); } /* signal stop if necessary */ if (stopper.stop()) { BOOST_AUTO(iter, node.children.begin()); for (; iter != node.children.end(); ++iter) { node.requests.push_front(iter->isend(0, MPI_TAG_STOPPER_STOP)); } } }
void enqueue2DRangeKernel(SEXP sQueue, SEXP sKernel, SEXP sGlobalWorkSize, SEXP sLocalWorkSize){ Rcpp::XPtr<cl_command_queue> queue(sQueue); Rcpp::XPtr<cl_kernel> kernel(sKernel); Rcpp::NumericVector gws(sGlobalWorkSize); Rcpp::NumericVector lws(sLocalWorkSize); size_t *globalWorkSizePtr = (size_t *) ::operator new(sizeof(size_t)*2); size_t *localWorkSizePtr = (size_t *) ::operator new(sizeof(size_t)*2); globalWorkSizePtr[0] = gws[0]; // TODO: check bounds on gws globalWorkSizePtr[1] = gws[1]; if (lws[0] == 0 && lws[1] == 0) { // TODO: check bounds on lws localWorkSizePtr = NULL; } else { localWorkSizePtr[0] = lws[0]; localWorkSizePtr[1] = lws[1]; } cl_int ciErr1 = clEnqueueNDRangeKernel(*queue, *kernel, 2, NULL, globalWorkSizePtr, localWorkSizePtr, 0, NULL, NULL); printOnError(ciErr1,"ROpenCL::enqueueNDRangeKernel()"); }