본문 바로가기

Computer Engineering15

[git] 특정한 branch의 pull request에 대해서 checkout 하기 간혹 라이브러리들 중에 pull request에 대해서 clone을 수행해야 할 때가 있다. 이게 무슨 의미냐면, 가령 caffe라는 라이브러리가 여러 개발자에 의해서 개발되고 있다고 하자. 그리고 개발 주요 내용은 dev라는 branch에 담겨 있다고 하자(사실상 caffe의 dev branch는 유지 되지 않는 것으로 나타나지만..). 개별 개발자들은 미래에 포함될 수 있는 후보 소스 코드들을 pulling한 상태로 가지고 있게 된다. 물론 commit 권한이 있으면 이 pulling된 내용을 해당 branch에 포함시킬 수도 있을 것이다. 어쨌든, 개발을 하다 보면, 내가 하려던 내용을 이미 남이 구현한 것을 발견하는 경우가 아주 아주 많다. 우리는 dev라는 branch에서 특정 pull requ.. 2015. 6. 27.
[c++] thread-safety of vector<bool> vector 형태는 thread-safe 하지 않다. 그러므로, 병렬화가 필요하다면, 반드시 bool 배열을 사용하자. 물론 큰 배열이 필요하다면, heap에 배열을 생성하고, 배열이 stack에 들어갈 수 있으면 local 배열로 선언하여 이용하자. 2015. 6. 16.
[cuda] scan scan은 cumulative 연산이다.exclusive cumulative sum은 다음과 같이 구현된다. exclusive는 현재 요소는 포함하지 않음을 나타낸다. op 부분은 sum 연산자로 대체된다. identity()는 해당 연산에 대해서 입력과 동일한 결과를 주는 파라미터의 값이다. sum의 경우에는 0이다. 가령, 1+0 = 1. int acc = identity(); for (int i = 0; i < elements.size(); ++i) { acc = acc op elements[i]; out[i] = acc;} 만약 위의 for loop 안의 순서를 바꾸게 되면, inclusive cumulative sum이 된다.exclusive는 가령 [1, 2, 3, 4] 가 있으면,[0, 1,.. 2015. 6. 14.
[cuda] udacity cs344 숙제 2 - student_func.cu // Homework 2// Image Blurring//// In this homework we are blurring an image. To do this, imagine that we have// a square array of weight values. For each pixel in the image, imagine that we// overlay this square array of weights on top of the image such that the center// of the weight array is aligned with the current pixel. To compute a blurred// pixel value, we multiply each pair of numbers t.. 2015. 6. 14.