- edited description
help me.
I am sorry my pure *English because i am Japaneses.
I have been trying built environment of HCC with R9 390 GPU and Ubuntu 16.04, but it's not fine.
I' m happy if someone give me a few information.
following is my trying.
first , I installed ubuntu 16.04 with selecting no installation of automatic update and third party software.
second installed hcc following below site. https://bitbucket.org/multicoreware/hcc/wiki/Developer%20Information
I executed below commands written in the guide site.
sudo apt-get install cmake git subversion g++ libstdc++-4.8-dev libdwarf-dev libelf-dev libtinfo-dev libc6-dev-i386 gcc-multilib llvm llvm-dev llvm-runtime libc++1 libc++-dev libc++abi1 libc++abi-dev re2c libncurses5-dev
then, I downloaded HCC package from here https://bitbucket.org/multicoreware/hcc/downloads/ I selected the package of "hcc-0.9.16045-c4b0995-ff03947-5a1009a-Linux.deb". and I installed.
I created a PATH to hcc by following command, export PATH=$PATH:/opt/hcc/bin
third, install AMDGPU-PRO driver form below. http://support.amd.com/en-us/kb-articles/Pages/AMD-Radeon-GPU-PRO-Linux-Beta-Driver%E2%80%93Release-Notes.aspx
4th, I compiled test cord with clang++ using the command of,
clang++ `clamp-config --install --cxxflags --ldflags` -o test.out test.cpp
compilation is success. but when it run, crash with kernel error in the case of using parallel_for_each.
*****************OK cord******************
int main()
{
gAcc = ChoseAccelerator();
gp_gau = new array<double,1>(1000*1000 , gAcc.get_default_view());
array_view<double,1> agau = *gp_gau;
cout << agau[2] << "\n";
return 0;
}
***********************************************
here is output.
chose accelerator to compute
0 : CPU Device
memory : 0 [GB]
support double precision : true
has display : false
1 : AMD
memory : 4.048 [GB]
support double precision : true
has display : false
2 : Intel
memory : 2.048 [GB]
support double precision : true
has display : false
device num = 1
1, yes sir
-5.48613e+303
*****************Bad cord induced error******************
int main()
{
gAcc = ChoseAccelerator();
gp_gau = new array<double,1>(1000*1000 , gAcc.get_default_view());
array_view<double,1> agau = *gp_gau;
parallel_for_each(
gAcc.get_default_view(),
agau.get_extent(),
[=](concurrency::index<1> id) restrict(amp)
{
agau[id] = agau[id] + 2.5;
}
);
cout << agau[2] << "\n";
return 0;
}
***********************************************
here is output.
Error: Kernel '&__OpenCL_ZZ4mainEN3_EC__019__cxxamp_trampolineEPdiiiiiii_kernel'
initialization failed.
Is there any person have knowledge to this problem ? please help me.
**appendix : full cord.****
#include <iostream>
#include <chrono>
#include <vector>
#include <string>
using std::cout;
using std::vector;
using std::string;
using std::cin;
using std::wcout;
#include <amp.h>
#include <amp_math.h>
using concurrency::array;
using concurrency::accelerator;
using concurrency::array_view;
using concurrency::parallel_for_each;
using concurrency::extent;
array<double , 1> *gp_gau;
accelerator ChoseAccelerator();
accelerator gAcc;
int main()
{
gAcc = ChoseAccelerator();
gp_gau = new array<double,1>(1000*1000 , gAcc.get_default_view());
array_view<double,1> agau = *gp_gau;
parallel_for_each(
gAcc.get_default_view(),
agau.get_extent(),
[=](concurrency::index<1> id) restrict(amp)
{
agau[id] = agau[id] + 2.5;
}
);
cout << agau[2] << "\n";
return 0;
}
accelerator ChoseAccelerator()//chosing accelerator
{
//get all accelerator on the system
vector<accelerator> allAcc = accelerator::get_all();
cout << "chose accelerator to compute" << "\n\n";
for(int i=0;i<allAcc.size();i++)
{
wcout << i <<" : "<< allAcc[i].get_description() << "\n";
cout << " memory : "
<< (double)allAcc[i].get_dedicated_memory()/1024/1000 << " [GB]\n";
cout << " support double precision : ";
if(allAcc[i].get_supports_double_precision())
cout << "true\n";
else
cout << "false\n";
cout << " has display : ";
if(allAcc[i].get_has_display())
cout << "true\n";
else
cout << "false\n";
}
cin.exceptions(std::ios::failbit);
int selAcs;
while(true)
{
cout << "\ndevice num = ";
try{
cin >> selAcs ;
}
catch(...){
cout << "please input a number\n";
cin.clear();
cin.seekg(0);
continue;
}
cout << "\n";
if(0 <= selAcs && selAcs < allAcc.size())
{
cout << selAcs <<", yes sir\n";
return allAcc[selAcs];
}
cout << "please input a number up to" << allAcc.size() -1 << ". "
<<selAcs<<" dosen't exist\n";
}
throw -1;//throw exceptions. this case will never occure.
}