@@ -935,6 +935,42 @@ TEST_F(TimestampEventCreate, givenEventWithStaticPartitionOffThenQueryTimestampE
935
935
EXPECT_EQ (ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, result);
936
936
}
937
937
938
+ class TimestampDeviceEventCreate : public Test <DeviceFixture> {
939
+ public:
940
+ void SetUp () override {
941
+ DeviceFixture::SetUp ();
942
+ ze_event_pool_desc_t eventPoolDesc = {};
943
+ eventPoolDesc.count = 1 ;
944
+ eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP;
945
+
946
+ ze_event_desc_t eventDesc = {};
947
+ eventDesc.index = 0 ;
948
+ eventDesc.signal = 0 ;
949
+ eventDesc.wait = 0 ;
950
+
951
+ ze_result_t result = ZE_RESULT_SUCCESS;
952
+ eventPool = std::unique_ptr<L0::EventPool>(L0::EventPool::create (driverHandle.get (), context, 0 , nullptr , &eventPoolDesc, result));
953
+ EXPECT_EQ (ZE_RESULT_SUCCESS, result);
954
+ ASSERT_NE (nullptr , eventPool);
955
+ event = std::unique_ptr<L0::EventImp<uint32_t >>(static_cast <L0::EventImp<uint32_t > *>(L0::Event::create<uint32_t >(eventPool.get (), &eventDesc, device)));
956
+ ASSERT_NE (nullptr , event);
957
+ }
958
+
959
+ void TearDown () override {
960
+ DeviceFixture::TearDown ();
961
+ }
962
+
963
+ std::unique_ptr<L0::EventPool> eventPool;
964
+ std::unique_ptr<L0::EventImp<uint32_t >> event;
965
+ };
966
+
967
+ TEST_F (TimestampDeviceEventCreate, givenTimestampDeviceEventThenAllocationsIsOfGpuDeviceTimestampType) {
968
+ auto allocation = &eventPool->getAllocation ();
969
+ ASSERT_NE (nullptr , allocation);
970
+
971
+ EXPECT_EQ (NEO::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, allocation->getAllocationType ());
972
+ }
973
+
938
974
using EventQueryTimestampExpWithSubDevice = Test<MultiDeviceFixture>;
939
975
940
976
TEST_F (EventQueryTimestampExpWithSubDevice, givenEventWhenQuerytimestampExpWithSubDeviceThenReturnsCorrectValueReturned) {
0 commit comments