reduction Questions
7
I am getting stuck with the Wikipedia description of the predecessor function in lambda calculus.
What Wikipedia says is the following:
PRED := λn.λf.λx. n (λg.λh. h (g f)) (λu.x) (λu.u)
Can someo...
Traitorous asked 9/1, 2012 at 14:51
9
Solved
I'm looking for some "inference rules" (similar to set operation rules or logic rules) which I can use to reduce a SQL query in complexity or size.
Does there exist something like that? Any papers...
Yashmak asked 1/7, 2009 at 14:14
1
Solved
Assume a 2*X(always 2 rows) pytorch tensor:
A = tensor([[ 1., 2., 2., 3., 3., 3., 4., 4., 4.],
[43., 33., 43., 76., 33., 76., 55., 55., 55.]])
torch.unique(A, dim=1) will return:
tensor([[ 1., 2....
5
Solved
I am trying to parallelize the following program, but don't know how to reduce on an array. I know it is not possible to do so, but is there an alternative? Thanks. (I added reduction on m which is...
Afb asked 6/12, 2013 at 0:57
3
Solved
All,
Below is the lambda expression which I am finding difficult to reduce i.e. I am not able to understand how to go about this problem.
(λm λn λa λb . m (n a b) b) (λ f x. x) (λ f x. f x)
This i...
Photosynthesis asked 28/7, 2010 at 23:11
2
Solved
I'm trying to reduce a df of observations to a single observation (single line).
I would like to summarize_if is numeric with the mean and if is string or factor with the mode. The code below doesn...
1
Solved
I've stumbled over some irritating things. I know that haskell works with weak head normal form (WHNF) and I know what this is. Typing the following code into ghci (I am using the command :sprint w...
Dag asked 4/2, 2020 at 11:9
4
Solved
I have a Java bean, like
class EmployeeContract {
Long id;
Date date;
getter/setter
}
If a have a long list of these, in which we have duplicates by id but with different date, such as:
1,...
Adalbertoadalheid asked 27/11, 2018 at 17:12
4
I am trying to write a code in CUDA for finding the max value
for the given set of numbers.
Assume you have 20 numbers, and the kernel is running on 2 blocks of 5 threads. Now assume the 10 threa...
Hygro asked 10/3, 2011 at 5:44
1
Solved
my @s=<1 2 3 2 3 4>;
say reduce {$^a < $^b}, @s;
say [<] @s;
# --------
# True
# False
My question is two fold:
Firstly, why does the reduction metaoperator processes the < operato...
5
Solved
I've got a 2D array comprised of boolean values (True,False). I'd like to consolidate the array to a 1D based on a logical function of the contents.
e.g.
Input:
[[True, True, False],
[False, F...
1
Solved
I'm compiling this simple program:
#include <numeric>
int main()
{
int numbers[] = {1, 2, 3, 4, 5};
auto num_numbers = sizeof(numbers)/sizeof(numbers[0]);
return std::accumulate(numbers...
Slade asked 6/10, 2018 at 9:15
4
I would like to apply a reduce on this piece of my kernel code (1 dimensional data):
__local float sum = 0;
int i;
for(i = 0; i < length; i++)
sum += //some operation depending on i here;
In...
Tango asked 16/12, 2013 at 14:15
0
There is a bug in intel compiler on user-defined reduction in OpenMP which was discussed here (including the wrokaround). Now I want to pass the vector to a function and do the same thing but I get...
1
Solved
Since OpenMP 4.0, user-defined reduction is supported. So I defined the reduction on std::vector in C++ exactly from here. It works fine with GNU/5.4.0 and GNU/6.4.0, but it returns random values f...
1
Solved
I tried for a long time to reduct this function in haskell, I want to express for example:
mySum x y = x + y
mySum x y = (+) x y
mySum x = (+) x
mySum = (+) -- it's Messi's goal!
My function it...
3
here is the question. I am wondering if there is a clear and efficient proof:
Vertex Cover: input undirected G, integer k > 0. Is there a subset of
vertices S, |S|<=k, that covers all edges?
D...
Orbicular asked 15/3, 2011 at 15:22
5
Solved
Does OpenMP natively support reduction of a variable that represents an array?
This would work something like the following...
float* a = (float*) calloc(4*sizeof(float));
omp_set_num_threads(13...
1
//In other words, this equilavent to cv::Mat1f mat(5,n)
//i.e. a matrix 5xn
std::vector<cv::Mat1f> mat(5,cv::Mat1f::zeros(1,n));
std::vector<float> indexes(m);
// fill indexes
// m >...
Mcrae asked 3/4, 2017 at 20:21
1
Solved
I want to make this code parallel:
std::vector<float> res(n,0);
std::vector<float> vals(m);
std::vector<float> indexes(m);
// fill indexes with values in range [0,n)
// fill vals...
Edessa asked 2/4, 2017 at 13:4
2
Solved
First of all, let me state that I am fully aware that my question has been already asked: Block reduction in CUDA However, as I hope to make clear, my question is a follow-up to that and I have par...
2
Solved
I am trying to implement an OpenCL version for doing reduction of a array of float.
To achieve it, I took the following code snippet found on the web :
__kernel void sumGPU ( __global const double ...
1
Solved
I was reading the presentation on Optimizing Parallel Reduction in CUDA by Mark Harris. Here is a slide I have problem in:
It says there is bank conflict problem in this method. But why? All thr...
Harmonious asked 21/11, 2016 at 19:49
1
Solved
I have a plotter like this one:
The task which I have to implement is conversion of 24 bits BMP to set of instructions for this plotter. In the plotter I can change 16 common colors. The first co...
Turbellarian asked 17/4, 2016 at 8:18
2
Both of reduction and collapse clauses in OMP confuses me,
some points raised popped into my head
Why reduction doesn't work with minus? as in the limitation listed here
Is there any work around ...
1 Next >
© 2022 - 2025 — McMap. All rights reserved.