thrust

Unable to create a thrust device vector

和自甴很熟 提交于 2020-12-11 08:47:24
问题 So I'm trying to start on GPU programming and using the Thrust library to simplify things. I have created a test program to work with it and see how it works, however whenever I try to create a thrust::device_vector with non-zero size the program crashes with "Run-time Check Failure #3 - The variable 'result' is being used without being initialized.' (this comes from the allocator_traits.inl file) And... I have no idea how to fix this. The following is all that is needed to cause this error.

Unable to create a thrust device vector

生来就可爱ヽ(ⅴ<●) 提交于 2020-12-11 08:47:03
问题 So I'm trying to start on GPU programming and using the Thrust library to simplify things. I have created a test program to work with it and see how it works, however whenever I try to create a thrust::device_vector with non-zero size the program crashes with "Run-time Check Failure #3 - The variable 'result' is being used without being initialized.' (this comes from the allocator_traits.inl file) And... I have no idea how to fix this. The following is all that is needed to cause this error.

Unable to create a thrust device vector

情到浓时终转凉″ 提交于 2020-12-11 08:46:20
问题 So I'm trying to start on GPU programming and using the Thrust library to simplify things. I have created a test program to work with it and see how it works, however whenever I try to create a thrust::device_vector with non-zero size the program crashes with "Run-time Check Failure #3 - The variable 'result' is being used without being initialized.' (this comes from the allocator_traits.inl file) And... I have no idea how to fix this. The following is all that is needed to cause this error.

How to improve computational time for sorting with thrust?

心不动则不痛 提交于 2020-07-23 06:20:19
问题 I found the method 'vectorized/batch sort' and 'nested sort' on below link. How to use Thrust to sort the rows of a matrix? When I tried this method for 500 row and 1000 elements, the result of them are vectorized/batch sort : 66ms nested sort : 3290ms I am using 1080ti HOF model to do this operation but it takes too long compared to your case. But in the below link, it could be less than 10ms and almost 100 microseconds. (How to find median value in 2d array for each column with CUDA?) Could

How to improve computational time for sorting with thrust?

本小妞迷上赌 提交于 2020-07-23 06:19:47
问题 I found the method 'vectorized/batch sort' and 'nested sort' on below link. How to use Thrust to sort the rows of a matrix? When I tried this method for 500 row and 1000 elements, the result of them are vectorized/batch sort : 66ms nested sort : 3290ms I am using 1080ti HOF model to do this operation but it takes too long compared to your case. But in the below link, it could be less than 10ms and almost 100 microseconds. (How to find median value in 2d array for each column with CUDA?) Could

How to improve computational time for sorting with thrust?

[亡魂溺海] 提交于 2020-07-23 06:18:21
问题 I found the method 'vectorized/batch sort' and 'nested sort' on below link. How to use Thrust to sort the rows of a matrix? When I tried this method for 500 row and 1000 elements, the result of them are vectorized/batch sort : 66ms nested sort : 3290ms I am using 1080ti HOF model to do this operation but it takes too long compared to your case. But in the below link, it could be less than 10ms and almost 100 microseconds. (How to find median value in 2d array for each column with CUDA?) Could

在发明者量化平台使用My语言实现Dual Thrust交易算法

你离开我真会死。 提交于 2020-03-06 13:10:59
1. Dual Thrust交易策略简介 Dual Thrust交易算法是由Michael Chalek开发的着名策略。它通常用于期货,外汇和股票市场。Dual Thrust的概念类似于典型的突破系统,使用双推力历史价格构建更新回溯期 - 理论上使其在任何给定时期内更稳定。 2. Dual Thrust交易策略的实现 在本文,我们简要介绍了该策略,并展示了如何在发明者量化平台上使用My语言实现此算法。在提取所选交易标的的历史价格后,该范围基于最近N天的收盘价,最高价和最低价计算。当市场从开盘价移动一定范围时,进行开仓操作。我们在两个市场状态下测试了该策略:趋势市场和区间震荡市场。结果表明,这种动量交易系统在趋势市场中运行得更好,但在波动较大的市场中会触发一些假买卖信号。在区间市场下,我们可以调整参数以获得更好的回报。 基本公式: 在当天收盘时,计算两个值:最高价格 - 收盘价格,收盘价格 - 最低价格。然后取较大的值并乘以k的值。 结果称为触发值。 在第二天开盘时,记录开盘价,然后在价格超过(开盘价+触发价值)时立即买入,或在价格低于(开盘价 - 触发价值)时卖空。 该系统是一个没有单独止损的反转系统。换句话说,反向信号也是平仓信号。 主图: 上轨道:公式:UPTRACK^^O + KSRG; 下轨道:公式:DOWNTRACK^^O-KXRG; 次要图表: My语言代码: HH:

Timing Kernel launches in CUDA while using Thrust

末鹿安然 提交于 2020-02-27 09:33:19
问题 Kernel launches in CUDA are generally asynchronous, which (as I understand) means that once the CUDA kernel is launched control returns immediately to the CPU. The CPU continues doing some useful work while the GPU is busy number crunching unless the CPU is forcefully stalled using cudaThreadsynchronize() or cudaMemcpy() . Now I have just started using the Thrust library for CUDA. Are the function calls in Thrust synchronous or asynchronous? In other words, if I invoke thrust::sort(D.begin()