library(gpuR)
A <- seq.int(from=0, to=999)
B <- seq.int(from=1000, to=1)
gpuA <- gpuVector(A)
gpuB <- gpuVector(B)
C <- A + B
gpuC <- gpuA + gpuB
gpuC
是gpuvector
。我想将输出视为数值。因此我尝试转换为cpuvector
。在RCUDA
包中,gathergpu()
中存在函数。但gpuR
包中没有类似的功能。
答案 0 :(得分:1)
您可以使用 public string SaveNewsDetails(List<TempNews> listTempNews, int RowCount)
{
int value;
string NewsStatus = string.Empty;
StringBuilder sqlBuilder = new StringBuilder();
DataAccess db = DataAccess.Create("Conn");
try
{
using (var trn = db.BeginTransaction())
{
foreach (var item in listTempNews)
{
IEnumerable<string> newsList = null;
sqlBuilder.Append("SELECT NewsCode ");
sqlBuilder.Append("FROM T_NEWS ");
sqlBuilder.Append("WHERE NewsCode = '" + item.N_Code + "'");
newsList = trn.Query<string>(sqlBuilder.ToString());
if (newsList == null || newsList.Count() == 0)
{
// Insert to table Query goes here
}
else
{
// Update Query Goes here
}
trn.Execute(sqlBuilder.ToString());
}
trn.Complete();
}
}
catch (Exception Ex)
{
}
return NewsStatus;
}
引用值,而无需任何参数:
[