添加#include <hipblas.h>头文件后,既然能够提示hipblasIdamax为什么不能识别hipblasIdamin
TimeStepGPU.cu:35:2: error: use of undeclared identifier 'hipblasIdamin'; did you mean 'hipblasIdamax'?
hipblasIdamin(handle1,gmeshl,d_gcb,1,&idex);
~~~~~~~~~
hipblasIdamax
TimeStepGPU.cu:
#include "hip/hip_runtime.h"
////////////////////////////////////////////////////////////////////////
// 在GPU上求最所有单元时间步长中的最小值
////////////////////////////////////////////////////////////////////////
// Include, culbas_v2
#include <hipblas.h>
//#include "CalculateAreaGPU.cu"
#include <stdio.h>
//#include "CalculateEndg.cu"
global void CalculateEndg(int numel, int gnnode, int ndf, int *ix, double *x, double *gcb);
extern "C"
void TimeStepGPU(int gmeshl, int gnnode, int ndf, int *d_ix, double *d_x,double &gdt1,double &gdt2, double gyms, double gro)
{
static bool frist = true;
static double d_gcb;
static hipblasHandle_t handle1;
int idex; double tempmin;
if(frist)
{
hipMalloc((void**)&d_gcb,sizeof(double)gmeshl);
// Init cublas
hipblasCreate(&handle1);
frist = false;
}
const unsigned int numThreadsTS=256;
const unsigned int numBlocksTS=(gmeshl+numThreadsTS-1)/numThreadsTS;
//hipLaunchKernelGGL(TimeStepGPU_GetArea, dim3(numBlocksTS), dim3(numThreadsTS), 0, 0, gmeshl,ndf,d_ix,d_x,d_gcb);
hipLaunchKernelGGL(CalculateEndg, dim3(numBlocksTS), dim3(numThreadsTS), 0, 0, gmeshl,gnnode,ndf,d_ix,d_x,d_gcb);
// 找到最小的值
hipblasIdamin(handle1,gmeshl,d_gcb,1,&idex);
hipblasGetVector(1,sizeof(double),&d_gcb[idex-1],1,&tempmin,1);
//最终计算时间步长
double wv = sqrt(gyms/gro);
gdt2 = gdt1;
gdt1 = 0.6 * tempmin / wv;
//gdt1 = tempmin / wv;
}

暂无数据
看起来是函数没有提前声明,是不是include文件漏掉了?
TimeStepGPU.cu中的hipblasIdamin改成hipblasIdamax,会有报错吗?
可以将相关代码截图发在上面,这样大家好清晰了解问题情况,左侧有编辑按钮,可进行添加
您好,根据您现有描述暂时无法确定问题原因。如果问题还未解决,可以分享下TimeStepGPU.cu文件我们共同分析一下。谢谢!