changed device code tests to work not to work as one

Change-Id: I0eec1eab19dda3b703bc3a0d778a6bbb2802a412
This commit is contained in:
Aditya Atluri
2017-01-27 09:20:14 -06:00
والد a8c51b822b
کامیت eee520def9
11فایلهای تغییر یافته به همراه116 افزوده شده و 10 حذف شده
@@ -19,6 +19,13 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
/* HIT_START
* BUILD: %t %s ../test_common.cpp
* RUN: %t
* HIT_END
*/
#include <hip/hip_runtime.h> #include <hip/hip_runtime.h>
#include <hip/device_functions.h> #include <hip/device_functions.h>
#include "test_common.h" #include "test_common.h"
@@ -62,3 +69,9 @@ __global__ void compileDoublePrecisionIntrinsics(hipLaunchParm lp, int ignored)
{ {
double_precision_intrinsics(); double_precision_intrinsics();
} }
int main()
{
hipLaunchKernel(compileDoublePrecisionIntrinsics, dim3(1,1,1), dim3(1,1,1), 0, 0, 1);
passed();
}
@@ -19,6 +19,13 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
/* HIT_START
* BUILD: %t %s ../test_common.cpp
* RUN: %t
* HIT_END
*/
#include <hip/hip_runtime.h> #include <hip/hip_runtime.h>
#include <hip/math_functions.h> #include <hip/math_functions.h>
#include "test_common.h" #include "test_common.h"
@@ -124,3 +131,9 @@ __global__ void compileDoublePrecisionMathOnDevice(hipLaunchParm lp, int ignored
{ {
double_precision_math_functions(); double_precision_math_functions();
} }
int main()
{
hipLaunchKernel(compileDoublePrecisionMathOnDevice, dim3(1,1,1), dim3(1,1,1), 0, 0, 1);
passed();
}
@@ -19,6 +19,13 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
/* HIT_START
* BUILD: %t %s ../test_common.cpp
* RUN: %t
* HIT_END
*/
#include <hip/hip_runtime.h> #include <hip/hip_runtime.h>
#include <hip/math_functions.h> #include <hip/math_functions.h>
#include "test_common.h" #include "test_common.h"
@@ -130,3 +137,9 @@ static void compileOnHost()
{ {
double_precision_math_functions(); double_precision_math_functions();
} }
int main()
{
compileOnHost();
passed();
}
@@ -19,6 +19,13 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
/* HIT_START
* BUILD: %t %s ../test_common.cpp
* RUN: %t
* HIT_END
*/
#include <hip/hip_runtime.h> #include <hip/hip_runtime.h>
#include <hip/math_functions.h> #include <hip/math_functions.h>
#include "test_common.h" #include "test_common.h"
@@ -120,4 +127,5 @@ __global__ void FloatMathPrecise(hipLaunchParm lp)
int main() { int main() {
hipLaunchKernel(FloatMathPrecise, dim3(1,1,1), dim3(1,1,1), 0, 0); hipLaunchKernel(FloatMathPrecise, dim3(1,1,1), dim3(1,1,1), 0, 0);
passed();
} }
@@ -19,6 +19,14 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
/* HIT_START
* BUILD: %t %s ../test_common.cpp
* RUN: %t
* HIT_END
*/
#include <hip/hip_runtime.h> #include <hip/hip_runtime.h>
#include <hip/device_functions.h> #include <hip/device_functions.h>
#include "test_common.h" #include "test_common.h"
@@ -57,3 +65,9 @@ __global__ void compileIntegerIntrinsics(hipLaunchParm lp, int ignored)
{ {
integer_intrinsics(); integer_intrinsics();
} }
int main()
{
hipLaunchKernel(compileIntegerIntrinsics, dim3(1,1,1), dim3(1,1,1), 0, 0, 1);
passed();
}
@@ -20,15 +20,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
/* HIT_START
* BUILD: %tHost %s hipSinglePrecisionMathHost.cpp hipDoublePrecisionMathHost.cpp ../test_common.cpp
* BUILD: %tDevice %s hipSinglePrecisionMathDevice.cpp hipDoublePrecisionMathDevice.cpp ../test_common.cpp
* BUILD: hipIntrinsics %s hipSinglePrecisionIntrinsics.cpp hipDoublePrecisionIntrinsics.cpp hipIntegerIntrinsics.cpp ../test_common.cpp
* RUN: %tHost
* RUN: %tDevice
* RUN: hipIntrinsics
* HIT_END
*/
#include "hip/hip_runtime.h" #include "hip/hip_runtime.h"
#include "test_common.h" #include "test_common.h"
@@ -19,6 +19,12 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
/* HIT_START
* BUILD: %t %s ../test_common.cpp
* RUN: %t
* HIT_END
*/
#include <hip/hip_runtime.h> #include <hip/hip_runtime.h>
#include <hip/device_functions.h> #include <hip/device_functions.h>
#include "test_common.h" #include "test_common.h"
@@ -78,3 +84,10 @@ __global__ void compileSinglePrecisionIntrinsics(hipLaunchParm lp, int ignored)
{ {
single_precision_intrinsics(); single_precision_intrinsics();
} }
int main()
{
hipLaunchKernel(compileSinglePrecisionIntrinsics, dim3(1,1,1), dim3(1,1,1), 0, 0, 1);
passed();
}
@@ -19,6 +19,13 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
/* HIT_START
* BUILD: %t %s ../test_common.cpp
* RUN: %t
* HIT_END
*/
#include <hip/hip_runtime.h> #include <hip/hip_runtime.h>
#include <hip/math_functions.h> #include <hip/math_functions.h>
#include "test_common.h" #include "test_common.h"
@@ -125,3 +132,9 @@ __global__ void compileSinglePrecisionMathOnDevice(hipLaunchParm lp, int ignored
{ {
single_precision_math_functions(); single_precision_math_functions();
} }
int main()
{
hipLaunchKernel(compileSinglePrecisionMathOnDevice, dim3(1,1,1), dim3(1,1,1), 0, 0, 1);
passed();
}
@@ -19,6 +19,13 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
/* HIT_START
* BUILD: %t %s ../test_common.cpp
* RUN: %t
* HIT_END
*/
#include <hip/hip_runtime.h> #include <hip/hip_runtime.h>
#include <hip/math_functions.h> #include <hip/math_functions.h>
#include "test_common.h" #include "test_common.h"
@@ -133,3 +140,9 @@ static void compileOnHost()
{ {
single_precision_math_functions(); single_precision_math_functions();
} }
int main()
{
compileOnHost();
passed();
}
@@ -17,8 +17,15 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
/* HIT_START
* BUILD: %t %s ../test_common.cpp
* RUN: %t
* HIT_END
*/
#include<hip/hip_runtime.h> #include<hip/hip_runtime.h>
#include<hip/hip_runtime_api.h> #include<hip/hip_runtime_api.h>
#include"test_common.h"
#include<iostream> #include<iostream>
#define NUM 1024 #define NUM 1024
@@ -72,4 +79,5 @@ int main()
for(unsigned i=0;i<NUM;i++) { for(unsigned i=0;i<NUM;i++) {
assert(A[i] == B[i]); assert(A[i] == B[i]);
} }
passed();
} }
@@ -17,9 +17,16 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
/* HIT_START
* BUILD: %t %s ../test_common.cpp
* RUN: %t
* HIT_END
*/
#include<iostream> #include<iostream>
#include<hip/hip_runtime_api.h> #include<hip/hip_runtime_api.h>
#include<hip/hip_runtime.h> #include<hip/hip_runtime.h>
#include"test_common.h"
#define NUM 1024 #define NUM 1024
#define SIZE NUM*sizeof(float) #define SIZE NUM*sizeof(float)
@@ -65,5 +72,5 @@ int main(){
hipLaunchKernel(vAdd, dim3(32,1,1), dim3(32,1,1), 0, 0, In1d, In2d, In3d, In4d, Outd); hipLaunchKernel(vAdd, dim3(32,1,1), dim3(32,1,1), 0, 0, In1d, In2d, In3d, In4d, Outd);
hipMemcpy(Out, Outd, SIZE, hipMemcpyDeviceToHost); hipMemcpy(Out, Outd, SIZE, hipMemcpyDeviceToHost);
assert(Out[10] == 2*In1[10] + 2*In2[10] + In3[10]); assert(Out[10] == 2*In1[10] + 2*In2[10] + In3[10]);
passed();
} }